From: Tim Kientzle Date: Sat, 2 May 2026 23:52:35 +0000 (-0700) Subject: [Zip] Reject overlong pathnames in Zip writer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a20f89eb9b6eed62ee691b4d36fdf4e1216e0ba1;p=thirdparty%2Flibarchive.git [Zip] Reject overlong pathnames in Zip writer --- diff --git a/libarchive/archive_write_set_format_zip.c b/libarchive/archive_write_set_format_zip.c index 81d3db0db..78cd63f0c 100644 --- a/libarchive/archive_write_set_format_zip.c +++ b/libarchive/archive_write_set_format_zip.c @@ -959,6 +959,11 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry) } } filename_length = path_length(zip->entry); + if (filename_length > 0xffff) { + archive_set_error(&a->archive, ENAMETOOLONG, + "Pathname too long for ZIP format"); + return (ARCHIVE_FAILED); + } /* Determine appropriate compression and size for this entry. */ if (type == AE_IFLNK) {