Memory leak and NULL dereference fixes.

PR#3403
This commit is contained in:
Dr. Stephen Henson
2014-06-27 03:21:10 +01:00
parent 3b3b69ab25
commit d2aea03829
11 changed files with 63 additions and 12 deletions

View File

@@ -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;