refactor(libmsg): 将审计结论合入代码注释并精简审计报告
- 在 libmsg 各头文件修复位置补充 [libmsg-audit <编号>] 标签(27 处), 覆盖 16 条安全审计发现(P0-1/P0-2/P1-1~3/P2-1~8/P3-1~3), 将已完成修复锚定到源码 - 从审计文档删除 335 行逐条详细发现(问题描述/修复方案/触发场景/代码块), 替换为 16 行「已解决发现」紧凑台账 + 源码定位指针 - 文档保留:严重等级表、修复进度汇总、已有安全机制、已知限制 L-1~L-12、 变更记录、审计结论
This commit is contained in:
1 parent
373045f0a3
commit
685c5c1754
6 files changed
+156
-438
No files matched your search
@@ -75,6 +75,7 @@ public:
|
||||
_timeout(timeout),
|
||||
_retry_on_refused(retry_on_refused),
|
||||
_retry_interval(retry_interval) {
|
||||
// [libmsg-audit P2-3] 入口边界校验:timeout ∈ (0,300]s,retry_interval ∈ (0,60]s。
|
||||
if (timeout <= 0 || timeout > 300.0) {
|
||||
throw MsgException("invalid timeout: " + std::to_string(timeout));
|
||||
}
|
||||
@@ -128,7 +129,8 @@ public:
|
||||
}
|
||||
const json::value& success = obj.at("success");
|
||||
if (!success.is_bool()) {
|
||||
// 类型不符时不要调用 as_bool()(会抛未捕获的 boost system_error),统一抛 RpcError
|
||||
// [libmsg-audit P3-1] 类型不符时不要调用 as_bool()(会抛未捕获的 boost system_error),
|
||||
// 统一抛 RpcError,与其余非法响应处理保持一致,避免底层异常泄露内部细节。
|
||||
throw RpcError("非法 RPC 响应(success 字段不是 bool)");
|
||||
}
|
||||
if (!success.as_bool()) {
|
||||
|
||||
Reference in new issue
Block a user