diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2002-08-23 00:02:11 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2002-08-23 00:02:11 +0000 |
commit | 41ab00bedf7259c60555a080219ed68e1afb8a22 (patch) | |
tree | de4d1dfb1d2d362b8c7b5ef97a550943bfa8038f /crypto/asn1/a_bitstr.c | |
parent | fc85ac20c7540c2db46235f32b3505db6ca7f304 (diff) |
Reinstate the check for invalid length BIT STRINGS,
which was effectively bypassed in the ASN1 changed.
Diffstat (limited to 'crypto/asn1/a_bitstr.c')
-rw-r--r-- | crypto/asn1/a_bitstr.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index ed0bdfbde1..e0265f69d2 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -120,6 +120,12 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp, unsigned char *p,*s; int i; + if (len < 1) + { + i=ASN1_R_STRING_TOO_SHORT; + goto err; + } + if ((a == NULL) || ((*a) == NULL)) { if ((ret=M_ASN1_BIT_STRING_new()) == NULL) return(NULL); |