summaryrefslogtreecommitdiff
path: root/backport-CVE-2023-45853.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-11-07 06:22:11 +0000
committerCoprDistGit <infra@openeuler.org>2026-11-07 06:22:11 +0000
commitd259e194df12569c8fe286eacd285be28118ecd7 (patch)
tree838258e9a13837f135e94257e7d17db9c9218608 /backport-CVE-2023-45853.patch
parentb1143670a63c1a72a4bd0e0e4337fc5fa3be85b4 (diff)
automatic import of zlibopeneuler24.03_LTS_SP3
Diffstat (limited to 'backport-CVE-2023-45853.patch')
-rw-r--r--backport-CVE-2023-45853.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/backport-CVE-2023-45853.patch b/backport-CVE-2023-45853.patch
new file mode 100644
index 0000000..f750e0f
--- /dev/null
+++ b/backport-CVE-2023-45853.patch
@@ -0,0 +1,39 @@
+From 73331a6a0481067628f065ffe87bb1d8f787d10c Mon Sep 17 00:00:00 2001
+From: Hans Wennborg <hans@chromium.org>
+Date: Fri, 18 Aug 2023 11:05:33 +0200
+Subject: [PATCH] Reject overflows of zip header fields in minizip.
+
+This checks the lengths of the file name, extra field, and comment
+that would be put in the zip headers, and rejects them if they are
+too long. They are each limited to 65535 bytes in length by the zip
+format. This also avoids possible buffer overflows if the provided
+fields are too long.
+---
+ contrib/minizip/zip.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
+index 3d3d4ca..0446109 100644
+--- a/contrib/minizip/zip.c
++++ b/contrib/minizip/zip.c
+@@ -1043,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c
+ return ZIP_PARAMERROR;
+ #endif
+
++ // The filename and comment length must fit in 16 bits.
++ if ((filename!=NULL) && (strlen(filename)>0xffff))
++ return ZIP_PARAMERROR;
++ if ((comment!=NULL) && (strlen(comment)>0xffff))
++ return ZIP_PARAMERROR;
++ // The extra field length must fit in 16 bits. If the member also requires
++ // a Zip64 extra block, that will also need to fit within that 16-bit
++ // length, but that will be checked for later.
++ if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff))
++ return ZIP_PARAMERROR;
++
+ zi = (zip64_internal*)file;
+
+ if (zi->in_opened_file_inzip == 1)
+--
+2.41.0.windows.3
+