From: Tim Kientzle Date: Sun, 12 Apr 2015 06:21:43 +0000 (-0700) Subject: Nudge the Zip64 cutoff a little higher. X-Git-Tag: v3.1.900a~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dbc86d80eddfac9943f9a3519c32e4a4ac4eda5;p=thirdparty%2Flibarchive.git Nudge the Zip64 cutoff a little higher. 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. --- diff --git a/libarchive/archive_write_set_format_zip.c b/libarchive/archive_write_set_format_zip.c index bad577132..043b1f844 100644 --- a/libarchive/archive_write_set_format_zip.c +++ b/libarchive/archive_write_set_format_zip.c @@ -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;