commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1426586 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Date Fri, 28 Dec 2012 17:29:53 GMT
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");
             }



Mime
View raw message