X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fasn1%2Fa_bitstr.c;fp=crypto%2Fasn1%2Fa_bitstr.c;h=b2e0fb688265ec48f8e43597d0c1476a633ffb25;hp=33be907f9d5edd33c2d086404d815fcb4b7b9f3b;hb=6b1c8204b33aaedb7df7a009c241412839aaf950;hpb=d2ef6e4ecc517de9d3d7f71180a6855f1f4d3243 diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index 33be907f9d..b2e0fb6882 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -7,6 +7,7 @@ * https://www.openssl.org/source/license.html */ +#include #include #include "internal/cryptlib.h" #include @@ -88,6 +89,11 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, goto err; } + if (len > INT_MAX) { + i = ASN1_R_STRING_TOO_LONG; + goto err; + } + if ((a == NULL) || ((*a) == NULL)) { if ((ret = ASN1_BIT_STRING_new()) == NULL) return (NULL);