aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/asn1/x_name.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/asn1/x_name.c')
-rw-r--r--crypto/openssl/crypto/asn1/x_name.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/openssl/crypto/asn1/x_name.c b/crypto/openssl/crypto/asn1/x_name.c
index b832deb928b0..1885d699efd5 100644
--- a/crypto/openssl/crypto/asn1/x_name.c
+++ b/crypto/openssl/crypto/asn1/x_name.c
@@ -141,10 +141,12 @@ static int i2d_X509_NAME_entries(X509_NAME *a)
}
size+=i2d_X509_NAME_ENTRY(ne,NULL);
}
-
- 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);