1 |
wellsi |
1.1 |
diff -up openssl-fips-0.9.8e/crypto/pkcs7/pk7_mime.c.bad-mime2 openssl-fips-0.9.8e/crypto/pkcs7/pk7_mime.c |
2 |
|
|
--- openssl-fips-0.9.8e/crypto/pkcs7/pk7_mime.c.bad-mime2 2012-03-19 17:42:34.000000000 +0100 |
3 |
|
|
+++ openssl-fips-0.9.8e/crypto/pkcs7/pk7_mime.c 2012-03-19 18:07:00.357352534 +0100 |
4 |
|
|
@@ -689,9 +689,8 @@ static int mime_hdr_addparam(MIME_HEADER |
5 |
|
|
static int mime_hdr_cmp(const MIME_HEADER * const *a, |
6 |
|
|
const MIME_HEADER * const *b) |
7 |
|
|
{ |
8 |
|
|
- if ((*a)->name == NULL || (*b)->name == NULL) |
9 |
|
|
- return (*a)->name - (*b)->name < 0 ? -1 : |
10 |
|
|
- (*a)->name - (*b)->name > 0 ? 1 : 0; |
11 |
|
|
+ if (!(*a)->name || !(*b)->name) |
12 |
|
|
+ return !!(*a)->name - !!(*b)->name; |
13 |
|
|
|
14 |
|
|
return(strcmp((*a)->name, (*b)->name)); |
15 |
|
|
} |
16 |
|
|
@@ -699,6 +698,8 @@ static int mime_hdr_cmp(const MIME_HEADE |
17 |
|
|
static int mime_param_cmp(const MIME_PARAM * const *a, |
18 |
|
|
const MIME_PARAM * const *b) |
19 |
|
|
{ |
20 |
|
|
+ if (!(*a)->param_name || !(*b)->param_name) |
21 |
|
|
+ return !!(*a)->param_name - !!(*b)->param_name; |
22 |
|
|
return(strcmp((*a)->param_name, (*b)->param_name)); |
23 |
|
|
} |
24 |
|
|
|