已关闭
【缺陷报告】空指针解引用 - 文件readable_dump.h - 函数ReadableDump::OutputHandler::GenNodeToOutputsMap - 行号78 #271
zhangjunkai9创建于 28 天前关闭于 23 天前
28 天前 将 gcw_V3YyYBt1 设为负责人
wangmingming
28 天前 评论:
28 天前 评论:
你好,感谢建议, 后续分析处理


23 天前 关闭了 issue
23 天前 添加了label:resolved
缺陷信息
缺陷描述
GenNodeToOutputsMap 在行78执行 node->GetOpDesc()->GetType(),未对 GetOpDesc() 返回值做空指针校验。经查 Node::NodeImpl::GetOpDesc()(node.cc:693-695)直接返回成员 op_(OpDescPtr),而同文件 UpdateOpDesc(行702)检查 op_!=nullptr 佐证 op_ 可能为 nullptr。其他代码(schedule_result.h:91,98,114)也显式检查 GetOpDesc()==nullptr,说明 GetOpDesc() 返回 nullptr 是真实场景。GenReadableDump 从 graph_utils.cc:1353 和 graph.cc:1043 可达,构成真实缺陷。
事实核查
数据流证据
传播路径:
修复建议
auto op_desc = node->GetOpDesc(); if (op_desc == nullptr) { continue; } if (op_desc->GetType() != kNetOutput) {