Files
openGauss-third_party/dependency/zlib/CVE-2023-45853.patch
2023-10-16 10:54:39 +08:00

22 lines
877 B
Diff

diff -Naur a/contrib/minizip/zip.c b/contrib/minizip/zip.c
--- a/contrib/minizip/zip.c 2023-10-16 10:30:43.399786707 +0800
+++ b/contrib/minizip/zip.c 2023-10-16 10:29:53.511135074 +0800
@@ -1083,6 +1083,17 @@
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)