• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

TLS/SSL and crypto library


Commit MetaInfo

Revision215276243d74b89fc8c28509d16dd2a107c65946 (tree)
Time2012-03-13 00:25:53
AuthorDr. Stephen Henson <steve@open...>
CommiterDr. Stephen Henson

Log Message

corrected fix to PR#2711 and also cover mime_param_cmp

Change Summary

Incremental Difference

--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -790,9 +790,8 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value)
790790 static int mime_hdr_cmp(const MIME_HEADER * const *a,
791791 const MIME_HEADER * const *b)
792792 {
793- if ((*a)->name == NULL || (*b)->name == NULL)
794- return (*a)->name - (*b)->name < 0 ? -1 :
795- (*a)->name - (*b)->name > 0 ? 1 : 0;
793+ if (!(*a)->name || !(*b)->name)
794+ return !!(*a)->name - !!(*b)->name;
796795
797796 return(strcmp((*a)->name, (*b)->name));
798797 }
@@ -800,6 +799,8 @@ static int mime_hdr_cmp(const MIME_HEADER * const *a,
800799 static int mime_param_cmp(const MIME_PARAM * const *a,
801800 const MIME_PARAM * const *b)
802801 {
802+ if (!(*a)->param_name || !(*b)->param_name)
803+ return !!(*a)->param_name - !!(*b)->param_name;
803804 return(strcmp((*a)->param_name, (*b)->param_name));
804805 }
805806