From 8a4e81a26916cf2ac8a18448d63baba3faa3b132 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 23 Feb 2012 21:50:13 +0000 Subject: [PATCH] PR: 2711 Submitted by: Tomas Mraz Tolerate bad MIME headers in parser. --- crypto/asn1/asn_mime.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index d8d9e76cc0..258cfd7325 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -790,6 +790,10 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value) static int mime_hdr_cmp(const MIME_HEADER * const *a, const MIME_HEADER * const *b) { + if ((*a)->name == NULL || (*b)->name == NULL) + return (*a)->name - (*b)->name < 0 ? -1 : + (*a)->name - (*b)->name > 0 ? 1 : 0; + return(strcmp((*a)->name, (*b)->name)); } -- 2.25.1