diff --git a/WHATSNEW b/WHATSNEW index 6fb87ff7a..43b16c46a 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -8,6 +8,9 @@ Changes that could break older environments: Fixed bugs: ----------- + * Parsing of zip64 extra fields has become more lenient in order to + be able to read archives created by DotNetZip and maybe other + archivers as well. Other changes: -------------- diff --git a/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java b/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java index c02b291c5..ad410e093 100644 --- a/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java +++ b/src/main/org/apache/tools/zip/Zip64ExtendedInformationExtraField.java @@ -240,7 +240,7 @@ public class Zip64ExtendedInformationExtraField * field with knowledge which fields are expected to be there. * *

All four fields inside the zip64 extended information extra - * field are optional and only present if their corresponding + * field are optional and must only be present if their corresponding * entry inside the central directory contains the correct magic * value.

*/ @@ -254,7 +254,7 @@ public class Zip64ExtendedInformationExtraField + (hasCompressedSize ? DWORD : 0) + (hasRelativeHeaderOffset ? DWORD : 0) + (hasDiskStart ? WORD : 0); - if (rawCentralDirectoryData.length != expectedLength) { + if (rawCentralDirectoryData.length < expectedLength) { throw new ZipException("central directory zip64 extended" + " information extra field's length" + " doesn't match central directory"