null derefernce sanity checks and control flow issue#8695
Merged
douzzer merged 4 commits intowolfSSL:masterfrom Apr 22, 2025
Merged
null derefernce sanity checks and control flow issue#8695douzzer merged 4 commits intowolfSSL:masterfrom
douzzer merged 4 commits intowolfSSL:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces additional null checks and adjusts control flow to address Coverity‐flagged warnings and potential null dereferences. Key changes include null argument validations in hpke.c and ssl_sess.c, updated test cases in tests/quic.c, a refined condition in ssl_load.c, and a restoration of the hsHashes pointer in internal.c.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| wolfcrypt/src/hpke.c | Added null checks for hpke and context parameters to prevent dereferencing. |
| tests/quic.c | Added a test to verify that a null argument returns the expected error. |
| src/ssl_sess.c | Introduced a null check in wolfSSL_SESSION_get_max_early_data to return BAD_FUNC_ARG. |
| src/ssl_load.c | Adjusted the condition to execute RSAPSSk-related logic only when ret equals 0. |
| src/internal.c | Restored the hsHashes pointer before returning on error. |
Comments suppressed due to low confidence (1)
src/ssl_load.c:1115
- The revised condition now requires ret to equal 0 before checking if *keyFormat is RSAPSSk, which may inadvertently bypass the RSAPSSk logic when ret is non-zero. Please verify that this control flow change is intended and that no valid cases are missed.
if((ret == 0) && (*keyFormat == RSAPSSk)) {
Contributor
|
retest this please ( |
dgarske
approved these changes
Apr 21, 2025
douzzer
approved these changes
Apr 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some warnings flagged by Coverity