OpenAtomFoundation / TobudOS

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

Fix: 字符数组expect_str越界 #367

Closed xy420513 closed 1 year ago

xy420513 commented 1 year ago

[

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

在OpenAtomFoundation/TencentOS-tiny/devices/air724/air724.c这个文件中,第389行创建的字符数组expect_str大小只有10,后续412行sprintf的字符串明显超出了10的大小,会发生数组越界,出现问题

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

将expect_str字符数组开大空间, 考虑到使用%d时未指定位数,因此开辟24的空间来保证一定不会越界,且考虑数据对齐

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

all

]

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.