summaryrefslogtreecommitdiff
path: root/openssl0.9.8/patches/CVE-2012-1165.patch
blob: 7abc720f5d5b9e694434c03e1d2d933a9a795e21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Index: openssl-0.9.8o/crypto/asn1/asn_mime.c
===================================================================
--- openssl-0.9.8o.orig/crypto/asn1/asn_mime.c	2009-03-08 23:05:34.000000000 +0000
+++ openssl-0.9.8o/crypto/asn1/asn_mime.c	2012-03-17 15:09:03.000000000 +0000
@@ -790,12 +790,17 @@
 static int mime_hdr_cmp(const MIME_HEADER * const *a,
 			const MIME_HEADER * const *b)
 {
+	if (!(*a)->name || !(*b)->name)
+		return !!(*a)->name - !!(*b)->name;
+
 	return(strcmp((*a)->name, (*b)->name));
 }
 
 static int mime_param_cmp(const MIME_PARAM * const *a,
 			const MIME_PARAM * const *b)
 {
+	if (!(*a)->param_name || !(*b)->param_name)
+		return !!(*a)->param_name - !!(*b)->param_name;
 	return(strcmp((*a)->param_name, (*b)->param_name));
 }