From 697e4edcadc13d61871518cf6111ff0349831afe Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Thu, 23 Feb 2012 21:50:32 +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 bbc4952918..dc2a35d0c8 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -858,6 +858,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