You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2012/12/28 18:29:53 UTC
svn commit: r1426586 -
/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
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");
}