From: Tomas Mraz Date: Tue, 24 Oct 2023 07:27:23 +0000 (+0200) Subject: Allow short reads in asn1_d2i_read_bio() X-Git-Tag: openssl-3.4.0-alpha1~316 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=202ef97edc8e5561a6f4db28919d5ed73d411cc7;p=thirdparty%2Fopenssl.git Allow short reads in asn1_d2i_read_bio() Reviewed-by: Neil Horman Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/22486) --- diff --git a/crypto/asn1/a_d2i_fp.c b/crypto/asn1/a_d2i_fp.c index 4af2276a8d0..f36c769b184 100644 --- a/crypto/asn1/a_d2i_fp.c +++ b/crypto/asn1/a_d2i_fp.c @@ -148,6 +148,9 @@ int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) goto err; } len += i; + if ((size_t)i < want) + continue; + } } /* else data already loaded */