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

Fix null pointer dereferencing #15406

Merged
merged 1 commit into from
May 22, 2023
Merged

Fix null pointer dereferencing #15406

merged 1 commit into from
May 22, 2023

Conversation

szsam
Copy link
Contributor

@szsam szsam commented Apr 20, 2023

Summary of changes

Add null check for return values of functions that are mostly (but not always) checked for null.
E.g., since 98% of calls to protocol_stack_interface_info_get_by_id check for null, it is likely that the function can return null values in some cases, and omitting the check could crash the program.

Impact of changes

Migration actions required

Documentation

I fixed the \return comment of eattGetCid(). I'm not sure if the doc needs update.


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


Add null check for return values of functions that are mostly (but not
always) checked for null.
E.g., since 98% of calls to protocol_stack_interface_info_get_by_id
check for null, it is likely that the function can return null values in
some cases, and omitting the check could crash the program.
@0xc0170 0xc0170 requested a review from pan- April 24, 2023 09:29
@0xc0170 0xc0170 added needs: review release-type: patch Indentifies a PR as containing just a patch labels Apr 24, 2023
@pan-
Copy link
Member

pan- commented May 5, 2023

@szsam This adds null check in many connectivity stack. Have you observed crashes yourself ?

@szsam
Copy link
Contributor Author

szsam commented May 5, 2023

@szsam This adds null check in many connectivity stack. Have you observed crashes yourself ?

Not really. These potentially missing null checks are found by static analysis tools

@mergify mergify bot added needs: CI and removed needs: review labels May 17, 2023
@0xc0170
Copy link
Contributor

0xc0170 commented May 17, 2023

CI started

@mbed-ci
Copy link

mbed-ci commented May 17, 2023

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@0xc0170 0xc0170 merged commit 1768ad9 into ARMmbed:master May 22, 2023
@mergify mergify bot removed the ready for merge label May 22, 2023
@akulpillai
Copy link

Hi! I’m a student researcher working with @szsam. We have identified this patch as one for a security vulnerability.

Will a CVE be issued for this?

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 31, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-type: patch Indentifies a PR as containing just a patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants