Skip to content

02202026 Coverity changes#9812

Merged
JacobBarthelmeh merged 3 commits intowolfSSL:masterfrom
rlm2002:coverity
Feb 23, 2026
Merged

02202026 Coverity changes#9812
JacobBarthelmeh merged 3 commits intowolfSSL:masterfrom
rlm2002:coverity

Conversation

@rlm2002
Copy link
Copy Markdown
Contributor

@rlm2002 rlm2002 commented Feb 20, 2026

Description

557571 Logically dead code - removed else block
557570 Dereference null return value - added null checks around revoked.serialNumber
327266 Use after free - Added s = NULL after sk_X509_pop_free(). Prevents scenario where ExpectIntEQ(sk_X509_num(s), 0) fails and following Expect*() functions are skipped.

Testing

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

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@rlm2002 rlm2002 self-assigned this Feb 20, 2026
@rlm2002
Copy link
Copy Markdown
Contributor Author

rlm2002 commented Feb 23, 2026

retest this please

@rlm2002 rlm2002 marked this pull request as ready for review February 23, 2026 20:16
@rlm2002 rlm2002 assigned wolfSSL-Bot and unassigned rlm2002 Feb 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@JacobBarthelmeh JacobBarthelmeh merged commit 505d170 into wolfSSL:master Feb 23, 2026
438 checks passed
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.

4 participants