RFR JDK-8186464: ZipFile cannot read some InfoZip ZIP64 zip files
xueming.shen at oracle.com
Tue Aug 22 01:35:08 UTC 2017
Please help review the proposed change for JDK-8186464.
It appears infozip always adds a ZIP64 format "end" record when there is
that needs ZIP64 support, even the ZIP64.end record itself is really not
the spec suggests, the ZIP64 format record is only needed if any of its
fields is too
small to hold the required data, which is not the case in this scenario.
126.96.36.199 If one of the fields in the end of central directory
record is too small to hold required data, the field should be
set to -1 (0xFFFF or 0xFFFFFFFF) and the ZIP64 format record
should be created.
That said, as Martin pointed out, the spec does not prevent the
from adding this ZIP64 format record even it's not necessary. Especially
fact infozip's implementation is actually doing it, it's reasonable to
be liberal here
to accept this layout in our implementation.
I have manually verified the change does fix the problem (either use the
jar tf or
java jdk.nio.zipfs.ZipInfo to check the offending zip file). Given the
nature of the
test case, I'm hesitated to add this test as a unit/regression into the
repo for now.
More information about the core-libs-dev