summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_bitstr.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2002-05-29 23:14:01 +0000
committerDr. Stephen Henson <steve@openssl.org>2002-05-29 23:14:01 +0000
commit08241a581454c1f0822e3d210d29d392c2403999 (patch)
tree0a0c28d43bd98626d57c9e5030c1e971f4584461 /crypto/asn1/a_bitstr.c
parent3d27b1fa85ea1ace004357bc9e61024225dc3b66 (diff)
Make i2c_ASN1_BIT_STRING return the correct length.
Diffstat (limited to 'crypto/asn1/a_bitstr.c')
-rw-r--r--crypto/asn1/a_bitstr.c6
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;