Fix a bug caused by the 'fix' for empty X509_NAME encoding.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 30 Mar 2001 00:58:49 +0000 (00:58 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 30 Mar 2001 00:58:49 +0000 (00:58 +0000)
crypto/asn1/x_name.c

index 585a375c4892938e91937fd08690cafcd2e4f87d..1885d699efd58315fcc88f4adb5619887b9408f9 100644 (file)
@@ -141,11 +141,12 @@ static int i2d_X509_NAME_entries(X509_NAME *a)
                        }
                size+=i2d_X509_NAME_ENTRY(ne,NULL);
                }
-       /* If empty no extra SET OF needed */
-       if (ret)
-               ret+=ASN1_object_size(1,size,V_ASN1_SET);
        if (fe != NULL)
+               {
+               /* SET OF needed only if entries is non empty */
+               ret+=ASN1_object_size(1,size,V_ASN1_SET);
                fe->size=size;
+               }
 
        r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE);