]> 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:06:35 +0000 (19:06 +0200)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/22486)

(cherry picked from commit 202ef97edc8e5561a6f4db28919d5ed73d411cc7)

crypto/asn1/a_d2i_fp.c

index e8602053f974f9013535522c3858b239e161f3f0..833dc104ddcfc01a0ba613369453f2c33e4cedb8 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 */