diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index c36817c1ee4ca7c654604db50f74e3e481a77a44..ed0bdfbde1a75ba478863bde12d351b4877ce6c7 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -71,8 +71,6 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) if (a == NULL) return(0); len=a->length; - ret=1+len; - if (pp == NULL) return(ret); if (len > 0) { @@ -100,6 +98,10 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) } else bits=0; + + ret=1+len; + if (pp == NULL) return(ret); + p= *pp; *(p++)=(unsigned char)bits;