summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2002-05-29 23:13:16 +0000
committerDr. Stephen Henson <steve@openssl.org>2002-05-29 23:13:16 +0000
commit9b652e84a85ee1e79ddcb7fe99744518c5cc5204 (patch)
tree2013d5fbfd24f4770d4bfa5f56d17422f4fa3e40 /crypto
parentb91c29147be6e84785f9b2d22dd18e0b8558331f (diff)
Make i2c_ASN1_BIT_STRING return the correct length.
Diffstat (limited to 'crypto')
-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 cdedb29e4f..ecc0d4b8cd 100644
--- a/crypto/asn1/a_bitstr.c
+++ b/crypto/asn1/a_bitstr.c
@@ -89,8 +89,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)
{
@@ -118,6 +116,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;