diff options
author | Arne Schwabe <arne@rfc2549.org> | 2015-02-12 22:22:25 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2015-02-12 22:22:25 +0100 |
commit | 9f0928c6593f937a17b7974b04051c57e3874b20 (patch) | |
tree | 1aaffa07a5c177fef2c1386f1850a688045bec2e /main/openssl/crypto/asn1/a_bitstr.c | |
parent | 68d26e1b1b5b411adce714c88532fc8889289f34 (diff) |
Update OpenSSL to AOSP -master
Diffstat (limited to 'main/openssl/crypto/asn1/a_bitstr.c')
-rw-r--r-- | main/openssl/crypto/asn1/a_bitstr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/openssl/crypto/asn1/a_bitstr.c b/main/openssl/crypto/asn1/a_bitstr.c index 34179960..4117a67d 100644 --- a/main/openssl/crypto/asn1/a_bitstr.c +++ b/main/openssl/crypto/asn1/a_bitstr.c @@ -136,11 +136,16 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, p= *pp; i= *(p++); + if (i > 7) + { + i=ASN1_R_INVALID_BIT_STRING_BITS_LEFT; + goto err; + } /* We do this to preserve the settings. If we modify * the settings, via the _set_bit function, we will recalculate * on output */ ret->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear */ - ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|(i&0x07)); /* set */ + ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|i); /* set */ if (len-- > 1) /* using one because of the bits left byte */ { |