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

20230724-cppcheck-2v11 #6652

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

douzzer
Copy link
Contributor

@douzzer douzzer commented Jul 25, 2023

fixes and workarounds for cppcheck 2.11 with uninitvar checks reactivated, and legacyUninitvar suppressed globally (as before):

src/internal.c:wolfSSL_DtlsUpdateWindow(): shiftTooManyBitsSigned and integerOverflowCond (true positive, fixed);

src/ssl.c:wolfSSL_GetSessionFromCache(): autoVariables (true positive, intentional and now suppressed);

wolfcrypt/src/asn.c: several uninitvars in EccSpecifiedECDomainDecode(), wc_EccPrivateKeyDecode(), DecodeSingleResponse(), and DecodeResponseData() (false positives due to bug in cppcheck short circuit eval analysis, mitigated by refactoring && expressions to nested-if constructs that are semantically identical);

src/ssl.c:wolfSSL_GetSessionFromCache(): nullPointer (false positive due to bug in cppcheck value flow analysis, workarounded).

tested with wolfssl-multi-test.sh ... super-quick-check 'cppcheck-.*'

note, I'm opening tickets upstream with cppcheck around the bugs in short-circuit evaluation and ValueFlow.

…ated, and legacyUninitvar suppressed globally (as before):

src/internal.c:wolfSSL_DtlsUpdateWindow(): shiftTooManyBitsSigned and integerOverflowCond (true positive, fixed);

src/ssl.c:wolfSSL_GetSessionFromCache(): autoVariables (true positive, intentional and now suppressed);

wolfcrypt/src/asn.c: several uninitvars in EccSpecifiedECDomainDecode(), wc_EccPrivateKeyDecode(), DecodeSingleResponse(), and DecodeResponseData() (false positives due to bug in cppcheck short circuit eval analysis, mitigated by refactoring && expressions to nested-if constructs that are semantically identical);

src/ssl.c:wolfSSL_GetSessionFromCache(): nullPointer (false positive due to bug in cppcheck value flow analysis, workarounded).
@douzzer
Copy link
Contributor Author

douzzer commented Jul 25, 2023

cppcheck has a fix for a related false positive uninitvar syndrome targeted for 2.12, per https://trac.cppcheck.net/ticket/11760, and there is an older more-similar bug at https://trac.cppcheck.net/ticket/11151 that specifically calls out short-circuit evaluation. both tickets live.

@douzzer
Copy link
Contributor Author

douzzer commented Jul 25, 2023

retest this please

@JacobBarthelmeh JacobBarthelmeh merged commit 746802b into wolfSSL:master Jul 25, 2023
71 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