forked from wolfSSL/wolfssl
Merge pull request #4010 from JacobBarthelmeh/fuzzing
fix for use after free issue on error cases
This commit is contained in:
@ -54469,6 +54469,7 @@ WOLFSSL_API PKCS7* wolfSSL_SMIME_read_PKCS7(WOLFSSL_BIO* in,
|
|||||||
|
|
||||||
|
|
||||||
wc_MIME_free_hdrs(allHdrs);
|
wc_MIME_free_hdrs(allHdrs);
|
||||||
|
allHdrs = NULL;
|
||||||
section[0] = '\0';
|
section[0] = '\0';
|
||||||
sectionLen = 0;
|
sectionLen = 0;
|
||||||
lineLen = wolfSSL_BIO_gets(in, section, remainLen);
|
lineLen = wolfSSL_BIO_gets(in, section, remainLen);
|
||||||
@ -54594,6 +54595,7 @@ error:
|
|||||||
if (canonSection != NULL)
|
if (canonSection != NULL)
|
||||||
XFREE(canonSection, NULL, DYNAMIC_TYPE_PKCS7);
|
XFREE(canonSection, NULL, DYNAMIC_TYPE_PKCS7);
|
||||||
wolfSSL_BIO_free(*bcont);
|
wolfSSL_BIO_free(*bcont);
|
||||||
|
*bcont = NULL; /* reset 'bcount' pointer to NULL on failure */
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user