Repository navigation
20261027 Coverity fixes - #11908
Open
rlm2002 wants to merge 4 commits into
Open
20261027 Coverity fixes#11908rlm2002 wants to merge 4 commits into
rlm2002 wants to merge 4 commits into
Conversation
prim_inited only stays set after an ERROR_OUT already made ret nonzero.
wc_HmacFree runs unconditionally even after an earlier assertion fails.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped test changes address the reported findings without identified blocking defects.
No open issues 🎉
What changed in this PR
This PR addresses Coverity findings in wolfSSL’s tests by removing unreachable code and initializing an HMAC structure for safe early-exit cleanup. No library implementation files are changed.
Changes:
- Remove redundant RNG cleanup error handling and an unreachable cleanup branch.
- Zero-initialize the HMAC test structure before potentially failing operations.
- Remove unreachable
CallbackTypeEndcase labels from CRL callback tests.
| File | Description |
|---|---|
| wolfcrypt/test/test.c | Simplifies unreachable RNG cleanup logic. |
| tests/api/test_hmac.c | Initializes the HMAC structure before early-exit cleanup. |
| tests/api/test_certman.c | Removes unreachable CRL callback switch labels. |
Review effort: Balanced
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
CID 565180, 565177, 565176, 565175: Logically dead code - Remove unreachable
case CallbackTypeEnd:switch cases in the CRL unknown-extension-callback tests intest_certman.cCID 565077: Logically dead code - Drop unreachable
retcapture around theprimcleanup inrng_drbg_rbgc_testCID 565075: Logically dead code - Remove unreachable
root_heldre-check inrng_lifecycle_testCID 565178: Uninitialized scalar variable - Zero-initialize
hmacintest_wc_HmacId_CryptoCbbefore it can be freed on an early-exit pathTesting
./configure --enable-all && make check