Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20250107-clang-tidy-null-derefs #8336

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

douzzer
Copy link
Contributor

@douzzer douzzer commented Jan 7, 2025

src/tls.c: fix possible null deref in TLSX_UseCertificateStatusRequestV2().

wolfcrypt/src/pkcs12.c: fix possible null deref in PKCS12_CoalesceOctetStrings(), and fix spelling of PKCS12_ConcatenateContent().

These defects were newly detected by clang-tidy in llvm-core/clang-20.0.0_pre20250104:

/tmp/tmp.4346_11739/wolfssl_test_workdir.22472/wolfssl/wolfcrypt/src/pkcs12.c:1278:9: note: Null pointer passed to 2nd parameter expecting 'nonnull'
1278 |         XMEMCPY(&data[*idx], mergedData, mergedSz);
|         ^
/tmp/tmp.4346_11739/wolfssl_test_workdir.22472/wolfssl/src/tls.c:4319:16: note: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'last')
4319 |         for (; last->next; last = last->next);
|                ^~~~

Tested with wolfssl-multi-test.sh ... clang-tidy-all-sp-all check-source-text.

…tV2().

wolfcrypt/src/pkcs12.c: fix possible null deref in PKCS12_CoalesceOctetStrings(), and fix spelling of PKCS12_ConcatenateContent().
@douzzer douzzer requested a review from wolfSSL-Bot January 7, 2025 06:07
@douzzer douzzer assigned douzzer and wolfSSL-Bot and unassigned douzzer Jan 7, 2025
@dgarske dgarske merged commit a3d879f into wolfSSL:master Jan 7, 2025
151 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.

3 participants