已关闭
【缺陷报告】空指针解引用 - 文件histogram_v2_op_tiling.cpp - 函数HistogramV2Tiling::Init - 行号159 #2772
zhangjunkai9创建于 20 天前关闭于 17 天前
陈思
20 天前 评论:
20 天前 评论:
19 天前 将 Nice_try 设为负责人
18 天前 关联了pull request:fix nullptrDef of histogram_v2 and add ut test
17 天前 关闭了 issue
17 天前 添加了label:resolved


缺陷信息
缺陷描述
tilingContext->GetInputShape(0) 返回值未做空指针校验即在第159行被解引用调用 GetStorageShape()。同模块 histogram_v2_simt_tiling.cpp:115 对 GetInputShape 返回值使用了 OP_CHECK_NULL_WITH_CONTEXT 检查,证明该 API 可能返回 nullptr;histogram_v2_base_tiling.cpp:31-34 也对 GetCompileInfo 返回值做了空指针校验。若 GetInputShape(0) 返回 nullptr,第159行 ->GetStorageShape() 将导致空指针解引用崩溃
事实核查
数据流证据
传播路径:
修复建议
auto inputShape = tilingContext->GetInputShape(0); OP_CHECK_NULL_WITH_CONTEXT(tilingContext, inputShape); auto selfShape = inputShape->GetStorageShape();