Closed janchochol closed 3 years ago
Thank you for the excellent report with how to generate a zip file that manifests the issue. This is fixed in https://github.com/madler/unzip/commit/122050bac16fae82a460ff739fb1ca0f106e9d85 . (Your patch would not fix the issue in general.)
Thanks for fix - your commit definitely makes more sense.
When zip file contains a file with central directory header without an extra filed (and thus the data descriptor is not in ZIP64 format),
G.zip64
flag is not reset.It can cause problems for zip files with mix of files larger and smaller than 4GB, created by compressors, which add extra fields only for files larger than 4GB (like Java).
This change resets
G.zip64
(by callinggetZip64Data
with empty buffer) in case of an empty extra field in central directory header.Following sequence of commands reproduces the problem:
Without the fix:
After the fix: