OpenAtomFoundation / TobudOS

开放原子开源基金会孵化的物联网操作系统,捐赠前为腾讯物联网终端操作系统TencentOS Tiny
https://cloud.tencent.com/product/tos-tiny
5.97k stars 1.61k forks source link

[HUST CSE] Fix: 字符数组str越界 #364

Closed suywang closed 1 year ago

suywang commented 1 year ago

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

在board/TencentOS_tiny_EVB_G0/KEIL/mqtt_iot_explorer_tc_pm25/demo/mqtt_iot_explorer_tc_pm25_oled.c这个文件中,第85行创建的字符数组str大小只有16,后续后续101和103行sprintf的字符串明显超出了16的大小,会发生数组越界,出现问题

你的解决方案是什么 (what is your solution)

将str字符数组开大空间,统计了一下最长是26,因此开辟30的空间

在什么测试环境下测试通过 (what is the test environment)

只增加了str的空间,因此测试一定会通过

]

tencent-adm commented 1 year ago

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.