Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HUST-CSE]Add null pointer check in OSA_TaskSetPriority #359

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

cospine
Copy link
Contributor

@cospine cospine commented Apr 18, 2023

1.这个PR修复的是什么问题?

源码 : if (ptaskStruct->priority > tcb->priority)
这段代码在while循环未进入时,tcb易产生空指针问题
此处给出文件路径:
platform/vendor_bsp/nxp/MIMXRT1052/components/osa/fsl_os_abstraction_bm.c

2.这个PR不修复具体会带来什么后果?

tcb->priority无效,并会导致指针错误、程序崩溃

3.PR修复方案的依据是什么?

在原判断条件的基础上,添加对于空指针的检验,保证了代码的安全性:
if ((NULL == tcb) || (ptaskStruct->priority > tcb->priority))

4. 在什么环境下测试或者验证过?

all

@tencent-adm
Copy link

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.

@Supowang Supowang merged commit 010055d into OpenAtomFoundation:master Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants