]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Nudge the Zip64 cutoff a little higher.
authorTim Kientzle <kientzle@acm.org>
Sun, 12 Apr 2015 06:21:43 +0000 (23:21 -0700)
committerTim Kientzle <kientzle@acm.org>
Sun, 12 Apr 2015 06:21:43 +0000 (23:21 -0700)
A simple test (feeding /dev/random through gzip) suggests
that deflate will only expand the data by 0.03% in the worst case.
So allow a 0.4% margin instead of the 6.25% I had here earlier.

libarchive/archive_write_set_format_zip.c

index bad577132773fa62e39ee3d509b3c2b89736f856..043b1f8440eeb10f971f70ad91fede81ec290d32 100644 (file)
@@ -722,12 +722,12 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
                 *  = Zip64 is being forced by user
                 *  = File is over 4GiB uncompressed
                 *    (including encryption header, if any)
-                *  = File is over 3.75GiB and is being compressed
+                *  = File is close to 4GiB and is being compressed
                 *    (compression might make file larger)
                 */
                if ((zip->flags & ZIP_FLAG_FORCE_ZIP64)
                    || (zip->entry_uncompressed_size + additional_size > 0xffffffffLL)
-                   || (zip->entry_uncompressed_size > 0xf0000000LL
+                   || (zip->entry_uncompressed_size > 0xff000000LL
                        && zip->entry_compression != COMPRESSION_STORE)) {
                        zip->entry_uses_zip64 = 1;
                        version_needed = 45;