OpenAtomFoundation / TobudOS

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

Access array elements before Cross border inspection #365

Closed blueothershore closed 1 year ago

blueothershore commented 1 year ago

DeviceClass_t devClass = MacCtx.NvmCtx->MulticastChannelList[groupID].ChannelParams.Class; Before executing this line of code, we'd better first check if the array is out of bounds, rather than placing a check after this line of code. Code modification: Swap the code position to advance the check for array out of bounds to the front of array access

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.