已关闭
【缺陷报告】空指针解引用 - 文件aclnn_remainder.cpp - 函数BroadcastTensor - 行号386 #2774
zhangjunkai9创建于 27 天前关闭于 24 天前
陈思
27 天前 评论:
27 天前 评论:
26 天前 将 Nice_try 设为负责人
26 天前 关联了pull request:fix nullptrDeref of aclnn_remainder
24 天前 关闭了 issue
24 天前 添加了label:resolved


缺陷信息
缺陷描述
第379行l0op::BroadcastTo返回nullptr时(第380-382行仅日志未return),或第386行l0op::ReFormat返回nullptr时(第387-389行仅日志未return),x均为nullptr但仍被后续使用。函数第391行return x返回nullptr给调用方,调用方虽做了CHECK_RET但BroadcastTensor内部在第378行x->GetViewShape()和第386行ReFormat传入null x时已触发空指针解引用。第二个null-check缺return与第一个同源。
事实核查
数据流证据
传播路径:
修复建议
x = l0op::BroadcastTo(x, broadcastShape, executor); if (x == nullptr) { OP_LOGE(ACLNN_ERR_PARAM_INVALID, "Broadcast result is nullptr."); return nullptr; } x = l0op::ReFormat(x, op::Format::FORMAT_ND); if (x == nullptr) { OP_LOGE(ACLNN_ERR_PARAM_INVALID, "Reformat result is nullptr."); return nullptr; } return x;