summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/asn_mime.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-06-27 03:21:10 +0100
committerDr. Stephen Henson <steve@openssl.org>2014-06-27 14:35:07 +0100
commitd2aea038297e0c64ca66e6844cbb37377365885e (patch)
tree13e11f5b4a91e0dc5316bb7c6fb7203c313be84b /crypto/asn1/asn_mime.c
parent3b3b69ab25fbaba80a843dedec5ae9733fefca43 (diff)
Memory leak and NULL dereference fixes.
PR#3403
Diffstat (limited to 'crypto/asn1/asn_mime.c')
-rw-r--r--crypto/asn1/asn_mime.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c
index 120889350c..116c3e7c60 100644
--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -683,6 +683,8 @@ static STACK_OF(MIME_HEADER) *mime_parse_hdr(BIO *bio)
int len, state, save_state = 0;
headers = sk_MIME_HEADER_new(mime_hdr_cmp);
+ if (!headers)
+ return NULL;
while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {
/* If whitespace at line start then continuation line */
if(mhdr && isspace((unsigned char)linebuf[0])) state = MIME_NAME;