Pull Request已成功合入, 合并人@openharmony_ci
(感谢 wangJE 的贡献)感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接。
Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.


提交次数已达到或超过3次,为了保证上库效率和减少构建资源浪费,请点击链接观看学习视频,谢谢!https://dcp.openharmony.cn/workbench/video/videoDisplay


🤖 AI 代码检视意见
类别: 🛡️ Reliability
严重级别: High
文件: adapter/common/net/bluetooth/broadcast/adapter/ble/src/softbus_ble_utils.c
行号: L484-L488
问题描述:
代码检查dst->advDevName[0] == '\0'但该缓冲区未被显式初始化。如果结构体在栈上分配,可能包含随机值,导致条件判断不可靠。在特定编译器优化或内存对齐情况下,可能误判或读取到脏数据。
修复建议:
确保SoftBusBcScanResult结构体在使用前被正确初始化。建议在结构体定义处添加构造函数或使用memset清零:
// 在分配SoftBusBcScanResult时
SoftBusBcScanResult scanResult = {0}; // 全部初始化为0
// 或者确保dst已被清零
memset(dst, 0, sizeof(SoftBusBcScanResult));
此评论由 OpenHarmony Insight Review Lite 自动生成


相关的Issue
https://gitcode.com/openharmony/communication_dsoftbus/issues/8680
原因(目的、解决的问题等)
描述(做了什么,变更了什么)
验证结果(新增、改动、可能影响的功能)
日志规范自检:
安全编码自检:
是否已执行L0用例