diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2002-05-29 23:11:55 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2002-05-29 23:11:55 +0000 |
commit | 3a4b0bed49677ba774d448fa546b14bcbebbf62c (patch) | |
tree | a88434ad2b6b41d24aeb0e9dc1a24e5758f8b13e /crypto/asn1 | |
parent | 84f4e33ea30d3bc52c0fac6fa4ce6b636b51297f (diff) |
Make i2c_ASN1_BIT_STRING return the correct length.
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/a_bitstr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index c36817c1ee..ed0bdfbde1 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; |