-
Notifications
You must be signed in to change notification settings - Fork 882
Coverity warning fixes #8907
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
base: master
Are you sure you want to change the base?
Coverity warning fixes #8907
Conversation
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.
These fixes are all trying to appease a static analyzer but do not improve the code.
wolfcrypt/src/asn.c
Outdated
|
||
int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm, | ||
WOLFSSL_LOCAL int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm, |
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.
This needs to be in the header, not the .c file.
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.
Make sure the header and .c definitions match. Remove the comment.
src/tls.c
Outdated
@@ -9384,8 +9384,9 @@ static int TLSX_KeyShare_ProcessEcc_ex(WOLFSSL* ssl, | |||
break; | |||
#endif | |||
default: | |||
/* unsupported curve */ | |||
curveId = ECC_CURVE_INVALID; |
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 revert this. The curveId not used can just be solved with the (void)curveId
below.
wolfcrypt/src/pkcs12.c
Outdated
@@ -830,7 +830,10 @@ int wc_d2i_PKCS12_fp(const char* file, WC_PKCS12** pkcs12) | |||
wc_PKCS12_free(*pkcs12); | |||
*pkcs12 = NULL; | |||
} | |||
XFREE(buf, NULL, DYNAMIC_TYPE_TMP_BUFFER); | |||
if (buf != NULL) { |
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.
XFREE already checks NULL. Just add the buf = NULL;
Description
Potential fixes for the Coverity warnings addressed in the support ticket.
Accidentally closed last pr for the same changes and it won't let me reopen for some reason.
Fixes zd#20029
Testing
How did you test?
Checklist