Skip to content

20261027 Coverity fixes - #11908

Open
rlm2002 wants to merge 4 commits into
wolfSSL:masterfrom
rlm2002:coverity
Open

rlm2002 wants to merge 4 commits into
wolfSSL:masterfrom
rlm2002:coverity

Conversation

@rlm2002

@rlm2002 rlm2002 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Description

CID 565180, 565177, 565176, 565175: Logically dead code - Remove unreachable case CallbackTypeEnd: switch cases in the CRL unknown-extension-callback tests in test_certman.c
CID 565077: Logically dead code - Drop unreachable ret capture around the prim cleanup in rng_drbg_rbgc_test
CID 565075: Logically dead code - Remove unreachable root_held re-check in rng_lifecycle_test
CID 565178: Uninitialized scalar variable - Zero-initialize hmac in test_wc_HmacId_CryptoCb before it can be freed on an early-exit path

Testing

./configure --enable-all && make check

@rlm2002 rlm2002 self-assigned this Oct 27, 2026
Copilot AI balanced review requested due to automatic review settings October 27, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 CallbackTypeEnd case 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

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.

2 participants