]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Allow short reads in asn1_d2i_read_bio()
authorTomas Mraz <tomas@openssl.org>
Tue, 24 Oct 2023 07:27:23 +0000 (09:27 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 18 Jul 2024 17:05:46 +0000 (19:05 +0200)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/22486)

crypto/asn1/a_d2i_fp.c

index 4af2276a8d02f12e27235602a058d290df2872eb..f36c769b1842ca1315cd6b1d6fa5043e65590a37 100644 (file)
@@ -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 */