Skip to content

20240120-multi-test-fixes#7152

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
douzzer:20240120-multi-test-fixes
Jan 22, 2024
Merged

20240120-multi-test-fixes#7152
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
douzzer:20240120-multi-test-fixes

Conversation

@douzzer
Copy link
Copy Markdown
Contributor

@douzzer douzzer commented Jan 20, 2024

src/x509.c: fix true-positive nullPointerRedundantCheck in wolfSSL_X509V3_set_ctx(). also adds thorough WOLFSSL_MSG() coverage for failures.

tested with ../testing/git-hooks/wolfssl-multi-test.sh ... super-quick-check

reported by

[cppcheck-all] [8 of 216] [d043333bee]
    configure...   real 0m13.156s  user 0m6.488s  sys 0m8.065s
    cppcheck...41ea1109ec (<john.bland@wolfssl.com> 2024-01-17 18:46:24 -0500 13856)     ctx->x509 = wolfSSL_X509_new_ex(issuer->heap);
src/x509.c:13856:37: warning: Either the condition 'issuer' is redundant or there is possible null pointer dereference: issuer. [nullPointerRedundantCheck]
    ctx->x509 = wolfSSL_X509_new_ex(issuer->heap);
                                    ^
25aa0af260 (<sean@wolfssl.com> 2022-04-06 17:25:26 +1000 13861)     if (issuer)
src/x509.c:13861:9: note: Assuming that condition 'issuer' is not redundant
    if (issuer)
        ^
41ea1109ec (<john.bland@wolfssl.com> 2024-01-17 18:46:24 -0500 13856)     ctx->x509 = wolfSSL_X509_new_ex(issuer->heap);
src/x509.c:13856:37: note: Null pointer dereference
    ctx->x509 = wolfSSL_X509_new_ex(issuer->heap);
                                    ^
   real 1m5.107s  user 7m37.876s  sys 0m23.773s
    cppcheck-all fail_analysis
    failed config: '--enable-all' '--enable-testcert' '--enable-srtp'

(among other cppcheck scenarios in the nightly.)

…. also adds thorough WOLFSSL_MSG() coverage for failures.
@douzzer
Copy link
Copy Markdown
Contributor Author

douzzer commented Jan 21, 2024

retest this please.

@JacobBarthelmeh JacobBarthelmeh merged commit 2617669 into wolfSSL:master Jan 22, 2024
Copy link
Copy Markdown
Contributor

@jpbland1 jpbland1 left a comment

Choose a reason for hiding this comment

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

I see I should have checked if those params were non-null, looks good now

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