From 4dbc86d80eddfac9943f9a3519c32e4a4ac4eda5 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sat, 11 Apr 2015 23:21:43 -0700 Subject: [PATCH] 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. --- libarchive/archive_write_set_format_zip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.2