-
Notifications
You must be signed in to change notification settings - Fork 835
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
No if xfree #7839
No if xfree #7839
Conversation
retest this please. Just a random test failure:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure all XFREE macros definitions have the if()
check and clearly document this in that area of the headers. Its already a rule and I'm glad we are getting consistent with this, but let's document all #define XFREE
examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quantum-safe-wolfssl-all-clang-tidy
found something to complain about:
[quantum-safe-wolfssl-all-clang-tidy] [22 of 32] [a31d8c5ce7]
configure... real 0m26.333s user 0m11.293s sys 0m16.875s
build...d350ba6c41 (<[email protected]> 2024-08-06 10:44:59 -0400 7938) XFREE(s1, key->heap, DYNAMIC_TYPE_DILITHIUM);
/tmp/tmp.4346_12509/wolfssl_test_workdir.35142/wolfssl/wolfcrypt/src/dilithium.c:7938:5: warning: Access to field 'heap' results in a dereference of a null pointer (loaded from variable 'key') [clang-analyzer-core.NullDereference]
7938 | XFREE(s1, key->heap, DYNAMIC_TYPE_DILITHIUM);
| ^
[...]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy-asn-template-sp-all-small-stack
found a similar defect in rsa.c
:
[clang-tidy-asn-template-sp-all-small-stack] [32 of 32] [a31d8c5ce7]
configure... real 0m26.067s user 0m11.164s sys 0m16.735s
build...d350ba6c41 (<[email protected]> 2024-08-06 10:44:59 -0400 5084) XFREE(p, key->heap, DYNAMIC_TYPE_RSA);
/tmp/tmp.4346_12509/wolfssl_test_workdir.35142/wolfssl/wolfcrypt/src/rsa.c:5084:5: warning: Access to field 'heap' results in a dereference of a null pointer (loaded from variable 'key') [clang-analyzer-core.NullDereference]
5084 | XFREE(p, key->heap, DYNAMIC_TYPE_RSA);
| ^
[...]
Remove 'if(ptr)' check before 'XFREE(ptr)'