Skip to content

coap_blockwise: test for null before dereferencing pointer #761

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

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

szczys
Copy link
Contributor

@szczys szczys commented Apr 9, 2025

The path member of the blockwise_transfer context is freed when the "finish" function is called. Test the context for NULL before trying to free the member.

Copy link

github-actions bot commented Apr 9, 2025

Visit the preview URL for this PR (updated for commit 9a87bfc):

https://golioth-firmware-sdk-doxygen-dev--pr761-szczys-blockwi-0c2sg5yf.web.app

(expires Fri, 18 Apr 2025 14:58:22 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a9993e61697a3983f3479e468bcb0b616f9a0578

@szczys szczys force-pushed the szczys/blockwise-test-null-ctx branch from fc3301d to bf79b33 Compare April 9, 2025 18:23
Copy link

github-actions bot commented Apr 9, 2025

Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
include.golioth 75% 50%
port.linux 62% 34%
port.utils 58% 46%
port.zephyr 53% 22%
src 70% 31%
Summary 68% (2849 / 4161) 31% (1177 / 3778)

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/coap_blockwise.c 0.00% 2 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/coap_blockwise.c 63.50% <0.00%> (-1.09%) ⬇️

... and 4 files with indirect coverage changes

The `path` member of the blockwise_transfer context is freed when the
"finish" function is called. Test the context for NULL before trying to
free the member.

Signed-off-by: Mike Szczys <[email protected]>
@szczys szczys force-pushed the szczys/blockwise-test-null-ctx branch from bf79b33 to 9a87bfc Compare April 11, 2025 14:56
@szczys szczys merged commit 07fe8d0 into main Apr 15, 2025
134 of 140 checks passed
@szczys szczys deleted the szczys/blockwise-test-null-ctx branch April 15, 2025 20:10
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