Skip to content

2020714 Coverity fixes#10902

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

2020714 Coverity fixes#10902
rlm2002 wants to merge 5 commits into
wolfSSL:masterfrom
rlm2002:coverity

Conversation

@rlm2002

@rlm2002 rlm2002 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Various coverity fixes

Use of 32-bit time_t - 561736: compare to paramTo->check_time directly to value.
Logically dead code - 561704: Remove dead check
Dereference before null check - 561665: Move myCtx check
Untrusted loop bound - 561218: Add bounds checks
Uninitialized scalar variable - 561786/561785/561784/561783/561782/561781: Add XMEMSET() to init vars

Testing

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

@rlm2002 rlm2002 self-assigned this Jul 14, 2026
@rlm2002

rlm2002 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins: Aarch64 Silicon Test - ERROR: Error cloning remote repo 'origin'

@rlm2002 rlm2002 assigned wolfSSL-Bot and unassigned rlm2002 Jul 15, 2026
@rlm2002

rlm2002 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins

@JacobBarthelmeh

Copy link
Copy Markdown
Contributor

@rlm2002 Looks like the Jenkins history might have been lost? Can you get this past the CI tests then re-assign to wolfssl-bot when ready?

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.

Pull request overview

This pull request applies targeted Coverity-driven fixes across wolfSSL tests and internal logic, addressing null dereferences, dead code, untrusted bounds, and uninitialized variables while keeping behavior consistent.

Changes:

  • Tighten null checking and remove a redundant/null-guarded dereference in the crypto device callback test helper.
  • Add initialization (XMEMSET) for several test-local structs/buffers to eliminate “uninitialized scalar/array” reports.
  • Add/adjust bounds checks for ECH extension parsing and remove logically dead bounds code in OCSP multi-stapling.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wolfcrypt/test/test.c Ensures myCtx is validated before use and simplifies a now-redundant null check.
tests/api/test_ossl_x509_vp.c Updates assertions to avoid time_t narrowing in ExpectIntEQ.
tests/api/test_ed25519.c Zero-initializes sig to avoid uninitialized-use reports in failure paths.
tests/api/test_dh.c Zero-initializes DH key structs before init calls to satisfy analysis tooling.
tests/api.c Adds an explicit bound check for ECH extension total length before iterating.
src/internal.c Removes dead bounds code in OCSP multi-response generation loop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/api/test_ossl_x509_vp.c Outdated
Comment thread tests/api/test_ossl_x509_vp.c Outdated
@rlm2002

rlm2002 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Retest this please Jenkins: FIPS tests failed, retrying with PR fix

@rlm2002 rlm2002 assigned wolfSSL-Bot and unassigned rlm2002 Jul 22, 2026
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