fixes for cppcheck uninitvar src/pk.c (false positives) and nullPointerRedundantCheck in src/ssl_load.c (true positive).

This commit is contained in:
Daniel Pouzzner
2024-04-17 01:00:41 -05:00
parent fac834c80a
commit 3df11e7eab
2 changed files with 4 additions and 4 deletions

View File

@@ -16198,7 +16198,7 @@ int wolfSSL_PEM_write_bio_PKCS8PrivateKey(WOLFSSL_BIO* bio,
int passwdSz, wc_pem_password_cb* cb, void* ctx) int passwdSz, wc_pem_password_cb* cb, void* ctx)
{ {
byte* pem = NULL; byte* pem = NULL;
int pemSz; int pemSz = 0;
int res = 1; int res = 1;
/* Validate parameters. */ /* Validate parameters. */
@@ -16243,7 +16243,7 @@ int wolfSSL_PEM_write_PKCS8PrivateKey(XFILE f, WOLFSSL_EVP_PKEY* pkey,
wc_pem_password_cb* cb, void* ctx) wc_pem_password_cb* cb, void* ctx)
{ {
byte* pem = NULL; byte* pem = NULL;
int pemSz; int pemSz = 0;
int res = 1; int res = 1;
/* Validate parameters. */ /* Validate parameters. */

View File

@@ -1529,7 +1529,7 @@ static void ProcessBufferCertSetHave(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
if (ssl != NULL) { if (ssl != NULL) {
ssl->pkCurveOID = cert->pkCurveOID; ssl->pkCurveOID = cert->pkCurveOID;
} }
else { else if (ctx) {
ctx->pkCurveOID = cert->pkCurveOID; ctx->pkCurveOID = cert->pkCurveOID;
} }
#endif #endif
@@ -1540,7 +1540,7 @@ static void ProcessBufferCertSetHave(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
if (ssl != NULL) { if (ssl != NULL) {
ssl->options.haveECC = ssl->options.haveECDSAsig; ssl->options.haveECC = ssl->options.haveECDSAsig;
} }
else { else if (ctx) {
ctx->haveECC = ctx->haveECDSAsig; ctx->haveECC = ctx->haveECDSAsig;
} }
#endif /* !WC_STRICT_SIG */ #endif /* !WC_STRICT_SIG */