diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c index 2b9c25611..eddaae6c9 100644 --- a/crypto/asn1/tasn_dec.c +++ b/crypto/asn1/tasn_dec.c @@ -1167,7 +1167,7 @@ static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len, return 0; #endif } - else if (!collect_data(buf, &p, plen)) + else if (plen && !collect_data(buf, &p, plen)) return 0; len -= p - q; }