diff --git a/src/ssl_api_pk.c b/src/ssl_api_pk.c index 36beecad9f..9df4dd9fc2 100644 --- a/src/ssl_api_pk.c +++ b/src/ssl_api_pk.c @@ -663,8 +663,9 @@ int wolfSSL_CTX_SetTmpEC_DHE_Sz(WOLFSSL_CTX* ctx, word16 sz) if (sz < ECC_MINSIZE) { ret = BAD_FUNC_ARG; } + else #endif - else if (sz > ECC_MAXSIZE) { + if (sz > ECC_MAXSIZE) { ret = BAD_FUNC_ARG; } else { diff --git a/src/ssl_p7p12.c b/src/ssl_p7p12.c index 0b43d71e6d..c4afebed91 100644 --- a/src/ssl_p7p12.c +++ b/src/ssl_p7p12.c @@ -1206,12 +1206,14 @@ PKCS7* wolfSSL_SMIME_read_PKCS7(WOLFSSL_BIO* in, /* If line endings were added, the initial length may be * exceeded. */ if ((canonPos + canonLineLen) >= canonSize) { + char* newCanonSection; canonSize = canonPos + canonLineLen; - canonSection = (char*)XREALLOC(canonSection, canonSize, + newCanonSection = (char*)XREALLOC(canonSection, canonSize, NULL, DYNAMIC_TYPE_PKCS7); - if (canonSection == NULL) { + if (newCanonSection == NULL) { goto error; } + canonSection = newCanonSection; } XMEMCPY(&canonSection[canonPos], canonLine, (int)canonLineLen - 1);