02202026 Coverity changes#9812
Merged
JacobBarthelmeh merged 3 commits intowolfSSL:masterfrom Feb 23, 2026
Merged
Conversation
Contributor
Author
|
retest this please |
JacobBarthelmeh
approved these changes
Feb 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses three Coverity static analysis issues in wolfSSL: logically dead code, potential null pointer dereference, and use-after-free scenarios in test code.
Changes:
- Removed unreachable error handling code in MakeSignature function
- Added defensive null pointer assignments after freeing X509 stacks in tests
- Added null checks and initialization for X509_REVOKED struct in CRL test
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| wolfcrypt/src/asn.c | Removed logically dead else block in MakeSignature - the outer condition guarantees at least one of rsaKey or eccKey is non-NULL |
| tests/api.c | Added s = NULL after sk_X509_pop_free calls to prevent use-after-free in test framework; added zero-initialization and null checks for revoked.serialNumber to prevent null pointer dereference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
557571 Logically dead code - removed
elseblock557570 Dereference null return value - added null checks around revoked.serialNumber
327266 Use after free - Added
s = NULLaftersk_X509_pop_free(). Prevents scenario whereExpectIntEQ(sk_X509_num(s), 0)fails and followingExpect*()functions are skipped.Testing
./configure --enable-all && make checkChecklist