Author: bodewig Date: Fri Dec 28 17:29:53 2012 New Revision: 1426586 URL: http://svn.apache.org/viewvc?rev=1426586&view=rev Log: if the inflater needs a dictionary, that's worth an exception
Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java?rev=1426586&r1=1426585&r2=1426586&view=diff ============================================================================== --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java Fri Dec 28 17:29:53 2012 @@ -382,8 +382,12 @@ public class ZipArchiveInputStream exten throws IOException { int read = readFromInflater(buffer, start, length); if (read == 0) { - if (inf.finished() || inf.needsDictionary()) { + if (inf.finished()) { return -1; + } else if (inf.needsDictionary()) { + throw new ZipException("This archive needs a preset dictionary" + + " which is not supported by Commons" + + " Compress."); } else if (buf.lengthOfLastRead == -1) { throw new IOException("Truncated ZIP file"); }