Skip to content

Commit

Permalink
Nudge the Zip64 cutoff a little higher.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kientzle committed Apr 12, 2015
1 parent 01cfbca commit 4dbc86d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libarchive/archive_write_set_format_zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4dbc86d

Please sign in to comment.