]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge branch 'master' into kientzle-zip-empty-pathname 2996/head
authorTim Kientzle <kientzle@acm.org>
Sun, 3 May 2026 16:38:55 +0000 (09:38 -0700)
committerGitHub <noreply@github.com>
Sun, 3 May 2026 16:38:55 +0000 (09:38 -0700)
1  2 
Makefile.am
libarchive/archive_write_set_format_zip.c
libarchive/test/CMakeLists.txt

diff --cc Makefile.am
Simple merge
index 452322d7a073ae256d951b0c2e7d1f60136d1723,78cd63f0c407794738ad7804bc5213e9e025d3b6..7668838095da33177047efcb20bda13cad7fdd9b
@@@ -960,12 -959,11 +960,19 @@@ archive_write_zip_header(struct archive
                }
        }
        filename_length = path_length(zip->entry);
++
++  /* Reject empty or overlong pathnames */
 +      path = archive_entry_pathname(zip->entry);
 +      if (path == NULL || path[0] == '\0') {
 +              archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 +                  "ZIP format requires a non-empty pathname");
 +              return (ARCHIVE_FAILED);
 +      }
+       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) {
Simple merge