diff --git a/src/pk.c b/src/pk.c index 0947d8c2f..8842a89a7 100644 --- a/src/pk.c +++ b/src/pk.c @@ -16198,7 +16198,7 @@ int wolfSSL_PEM_write_bio_PKCS8PrivateKey(WOLFSSL_BIO* bio, int passwdSz, wc_pem_password_cb* cb, void* ctx) { byte* pem = NULL; - int pemSz; + int pemSz = 0; int res = 1; /* Validate parameters. */ @@ -16243,7 +16243,7 @@ int wolfSSL_PEM_write_PKCS8PrivateKey(XFILE f, WOLFSSL_EVP_PKEY* pkey, wc_pem_password_cb* cb, void* ctx) { byte* pem = NULL; - int pemSz; + int pemSz = 0; int res = 1; /* Validate parameters. */ diff --git a/src/ssl_load.c b/src/ssl_load.c index 43982c4dc..2d92e5f3d 100644 --- a/src/ssl_load.c +++ b/src/ssl_load.c @@ -1529,7 +1529,7 @@ static void ProcessBufferCertSetHave(WOLFSSL_CTX* ctx, WOLFSSL* ssl, if (ssl != NULL) { ssl->pkCurveOID = cert->pkCurveOID; } - else { + else if (ctx) { ctx->pkCurveOID = cert->pkCurveOID; } #endif @@ -1540,7 +1540,7 @@ static void ProcessBufferCertSetHave(WOLFSSL_CTX* ctx, WOLFSSL* ssl, if (ssl != NULL) { ssl->options.haveECC = ssl->options.haveECDSAsig; } - else { + else if (ctx) { ctx->haveECC = ctx->haveECDSAsig; } #endif /* !WC_STRICT_SIG */