]> granicus.if.org Git - openssl/commitdiff
PR: 1422
authorDr. Stephen Henson <steve@openssl.org>
Sun, 15 Feb 2009 12:10:39 +0000 (12:10 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 15 Feb 2009 12:10:39 +0000 (12:10 +0000)
Fix return value of X509_NAME_cmp() so it works with qsort/bsearch again.

crypto/x509/x509_cmp.c

index e4c682fc44edb65c8427fce52b1e45badf11a669..2faf92514a259cb7f15758618c699da608264866 100644 (file)
@@ -288,7 +288,8 @@ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b)
                        if (!(nabit & STR_TYPE_CMP) ||
                                !(nbbit & STR_TYPE_CMP))
                                return j;
-                       j = asn1_string_memcmp(na->value, nb->value);
+                       if (!asn1_string_memcmp(na->value, nb->value))
+                               j = 0;
                        }
                else if (na->value->type == V_ASN1_PRINTABLESTRING)
                        j=nocase_spacenorm_cmp(na->value, nb->value);