Fix get_email: 0 is a valid return value
authorDr. Stephen Henson <steve@openssl.org>
Thu, 14 Nov 2002 00:45:04 +0000 (00:45 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 14 Nov 2002 00:45:04 +0000 (00:45 +0000)
crypto/x509v3/v3_utl.c

index 283e943e4624d96311749410b3cc4322e09f6c1f..34ac2998defe5c661148a6bfa883a6622def35c4 100644 (file)
@@ -491,7 +491,7 @@ static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens)
        i = -1;
        /* First supplied X509_NAME */
        while((i = X509_NAME_get_index_by_NID(name,
-                                        NID_pkcs9_emailAddress, i)) > 0) {
+                                        NID_pkcs9_emailAddress, i)) >= 0) {
                ne = X509_NAME_get_entry(name, i);
                email = X509_NAME_ENTRY_get_data(ne);
                if(!append_ia5(&ret, email)) return NULL;