commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug #789] java.util.zip.InflaterInputStream broken for zero-length read


From: nobody
Subject: [Bug #789] java.util.zip.InflaterInputStream broken for zero-length reads
Date: Tue, 02 Jul 2002 10:19:41 -0400

=================== BUG #789: FULL BUG SNAPSHOT ===================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=789&group_id=85

Submitted by: None                      Project: classpath                      
Submitted on: 2002-Jul-02 10:19
Severity:  5 - Major                    Resolution:  None                       
Assigned to:  None                      Status:  Open                           
Platform Version:  Red Hat 7.x          

Summary:  java.util.zip.InflaterInputStream broken for zero-length reads

Original Submission:  The 
java.util.zip.InflaterInputStream.read(byte[],int,int) method does not work 
correctly for zero-length reads.  These cause Inflater.inflate() to be called 
with len == 0, which results in an IllegalArgumentException.

Here is an obvious fix:
diff -u -r1.4 InflaterInputStream.java
--- java/util/zip/InflaterInputStream.java      2002/06/17 17:10:56     1.4
+++ java/util/zip/InflaterInputStream.java      2002/07/02 14:13:57
@@ -182,6 +182,10 @@
    */
   public int read(byte[] b, int off, int len) throws IOException
   {
+    // Special case for zero-length reads.
+    if (len == 0)
+      return 0;
+
     for (;;)
       {
        int count;




No Followups Have Been Posted




No files currently attached


For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=789&group_id=85



reply via email to

[Prev in Thread] Current Thread [Next in Thread]