已关闭
【缺陷报告】空指针解引用 - 文件histogram_v2_infershape.cpp - 函数HistogramV2InferShapeFunc - 行号29 #2771
zhangjunkai9创建于 25 天前关闭于 21 天前
陈思
24 天前 评论:
24 天前 评论:
23 天前 将 Nice_try 设为负责人
23 天前 关联了pull request:fix nullptrDef of histogram_v2 and add ut test
21 天前 关闭了 issue
21 天前 添加了label:resolved


缺陷信息
缺陷描述
attr->GetAttrPointer<int64_t>(BINS_IDX)返回值未做空指针校验即通过*运算符解引用。同模块histogram_fixed_width_infershape.cpp:47-48对GetAttrPointer返回值使用OP_CHECK_NULL_WITH_CONTEXT检查,本文件虽检查了attr非空但未检查GetAttrPointer返回值,若属性缺失则解引用崩溃
事实核查
数据流证据
传播路径:
调用链
可达调用链1 起点:
(entry functions)→ 终点:ops::HistogramV2InferShapeFunc深度:0修复建议
auto binsPtr = attr->GetAttrPointer<int64_t>(BINS_IDX); OP_CHECK_NULL_WITH_CONTEXT(context, binsPtr); int64_t bins = *binsPtr;