Skip to content

Commit 3df11e7

Browse files
committed
fixes for cppcheck uninitvar src/pk.c (false positives) and nullPointerRedundantCheck in src/ssl_load.c (true positive).
1 parent fac834c commit 3df11e7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/pk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16198,7 +16198,7 @@ int wolfSSL_PEM_write_bio_PKCS8PrivateKey(WOLFSSL_BIO* bio,
1619816198
int passwdSz, wc_pem_password_cb* cb, void* ctx)
1619916199
{
1620016200
byte* pem = NULL;
16201-
int pemSz;
16201+
int pemSz = 0;
1620216202
int res = 1;
1620316203

1620416204
/* Validate parameters. */
@@ -16243,7 +16243,7 @@ int wolfSSL_PEM_write_PKCS8PrivateKey(XFILE f, WOLFSSL_EVP_PKEY* pkey,
1624316243
wc_pem_password_cb* cb, void* ctx)
1624416244
{
1624516245
byte* pem = NULL;
16246-
int pemSz;
16246+
int pemSz = 0;
1624716247
int res = 1;
1624816248

1624916249
/* Validate parameters. */

src/ssl_load.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ static void ProcessBufferCertSetHave(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
15291529
if (ssl != NULL) {
15301530
ssl->pkCurveOID = cert->pkCurveOID;
15311531
}
1532-
else {
1532+
else if (ctx) {
15331533
ctx->pkCurveOID = cert->pkCurveOID;
15341534
}
15351535
#endif
@@ -1540,7 +1540,7 @@ static void ProcessBufferCertSetHave(WOLFSSL_CTX* ctx, WOLFSSL* ssl,
15401540
if (ssl != NULL) {
15411541
ssl->options.haveECC = ssl->options.haveECDSAsig;
15421542
}
1543-
else {
1543+
else if (ctx) {
15441544
ctx->haveECC = ctx->haveECDSAsig;
15451545
}
15461546
#endif /* !WC_STRICT_SIG */

0 commit comments

Comments
 (0)