Closed shannah closed 4 years ago
Thanks for the sample zip. I was able to reproduce this issue. Will look into it.
I wonder which tool was used to create the zip file. It slightly deviated from the zip specification. Zip4j was designed to overcome such inconsistencies, but however, there was a problem with that logic which can arise in some specific circumstances. I fixed it. I will include the fix in the next release.
Technical info related to the error (if you are interested in details or for my future reference): The entry in the zip file had a zip64 header written to it. When this entry is defined, the corresponding entries in the zip headers have to be defined as the maximum limit in the headers. For example, the compressed size in the header has to be set to set as 4294967295
when the corresponding compressed size in zip64 header is written. But this was not the case. The original length of ~ 8kb was written in the entry header. I wonder why the tool was writing zip64 entry in the first place, because this header block is only supposed to be used when any of the sizes exceeds the usual 4 byte limit, but this was not the case in any of the sizes of this entry.
The zip file was created by Ant's Zip task.
<zip destfile="src/com/client4j/publisher/website_template.zip" basedir="web_template" />
The Ant version is 1.10.4 (part of Netbeans 11.2 distribution).
Fixed in v2.3.1 released today.
Happened with me. Unfortunately, I can not provide a zip file publicly :(
I am having this problem right now again with Zip4J 2.11.1. Unfortunately I am unable to provide the file as it contains confidential information of our client. 7zip does not complain about the file.
I am having this problem right now again with Zip4J 2.11.5
I have the same linked Fossify File Manager bug in 1.0.1, which uses Zip4J 2.11.5.
Latest from git fails to extract zip file that appears to be fine. The error:
I have forked the project and added a test case here:
https://github.com/shannah/zip4j
Zip file in question: https://github.com/shannah/zip4j/blob/master/src/test/resources/test-archives/website_template.zip
Test case https://github.com/shannah/zip4j/blob/master/src/test/java/net/lingala/zip4j/ExtractZipFileIT.java#L386-L391