已关闭
fix: 保护空 UDS 路径,避免越界访问 #57
gcw_Nt0RibX4创建于 9月10日关闭于 11 天前
9月10日 将 hlinbo、shw030915、Gao_Victor、qmyyxtl、caowaterman、gcw_Nt0RibX4 设为负责人
9月10日 添加了label:sig/sig-UB-ServiceCore
openeuler-ci-bot
9月10日 评论:
9月10日 评论:
Welcome To openEuler Community
Hey @gcw_Nt0RibX4 , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
Contact Guide
If you have any questions, please contact the SIG: sig-UB-ServiceCore ,
and any of the maintainers: @Gao_Victor, @caowaterman, @hlinbo, @qmyyxtl, @shw030915 ,
and any of the committers: @deepsleep_mem, @liu1103xwxw .


9月10日 关联了pull request:fix: prevent empty UDS path from causing out-of-bounds access
11 天前 issue状态由 待办的 改变为 已完成
11 天前 关闭了 issue
描述:
在 mxm_com_engine.cpp 中的 MkdirRecursive() 函数中,代码直接访问了 path[0],未先检查 path 是否为空。
当前逻辑如下:
if (path[0] == '/') { ... }
当调用方传入空字符串时,path.empty() == true,此时访问 path[0] 会发生越界访问,导致未定义行为,可能造成进程崩溃或错误分支执行。
影响:
传入空的 IPC/UDS 路径时,可能导致运行时异常
会影响服务启动或目录创建逻辑
属于典型的输入校验缺陷,具备稳定性和安全性风险
修复建议:
在访问 path[0] 前增加空字符串判断:
if (path.empty()) { return false; }