[Top][All Lists]
[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: |
Fri, 05 Jul 2002 17:30:02 -0400 |
=================== BUG #789: LATEST MODIFICATIONS ==================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=789&group_id=85
Changes by: Jochen Hoenicke <address@hidden>
Date: 2002-Jul-05 23:30 (Europe/Berlin)
What | Removed | Added
---------------------------------------------------------------------------
Resolution | None | Fixed
Assigned to | None | jochen
Status | Open | Closed
------------------ Additional Follow-up Comments ----------------------------
Fixed. I changed the check in Inflater.inflate(byte[],int,int)
instead.
=================== BUG #789: FULL BUG SNAPSHOT ===================
Submitted by: None Project: classpath
Submitted on: 2002-Jul-02 16:19
Severity: 5 - Major Resolution: Fixed
Assigned to: jochen Status: Closed
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;
Follow-up Comments
*******************
-------------------------------------------------------
Date: 2002-Jul-05 23:30 By: jochen
Fixed. I changed the check in Inflater.inflate(byte[],int,int)
instead.
No files currently attached
For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=789&group_id=85