From a858b8036ca63697312c282429ee84beeec599a6 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 30 Mar 2001 00:58:49 +0000 Subject: [PATCH] Fix a bug caused by the 'fix' for empty X509_NAME encoding. --- crypto/asn1/x_name.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crypto/asn1/x_name.c b/crypto/asn1/x_name.c index 585a375c48..1885d699ef 100644 --- a/crypto/asn1/x_name.c +++ b/crypto/asn1/x_name.c @@ -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); -- 2.25.1