From 9b099cfe9b8ff48ebf73f26baf1ffb356d3ab825 Mon Sep 17 00:00:00 2001 From: miod <> Date: Fri, 11 Jul 2014 13:41:59 +0000 Subject: More memory leaks and unchecked allocations; OpenSSL PR #3403 via OpenSSL trunk. (note we had already fixed some of the issues in that PR independently) --- src/lib/libcrypto/asn1/asn_mime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/asn1/asn_mime.c') diff --git a/src/lib/libcrypto/asn1/asn_mime.c b/src/lib/libcrypto/asn1/asn_mime.c index 41b39efa7b..994531837f 100644 --- a/src/lib/libcrypto/asn1/asn_mime.c +++ b/src/lib/libcrypto/asn1/asn_mime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn_mime.c,v 1.20 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: asn_mime.c,v 1.21 2014/07/11 13:41:59 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -675,6 +675,8 @@ 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])) -- cgit v1.2.3-55-g6feb