This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix PR 24461
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 09 Mar 2006 13:16:17 -0700
- Subject: Patch: FYI: fix PR 24461
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk and the 4.1 branch.
This fixes PR 24461 by merging in a bit of code from Classpath.
I'll put the test case from the PR into Mauve a bit later.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
PR libgcj/24461:
* java/util/zip/InflaterInputStream.java (fill): Throw exception
if stream is truncated.
Index: java/util/zip/InflaterInputStream.java
===================================================================
--- java/util/zip/InflaterInputStream.java (revision 111868)
+++ java/util/zip/InflaterInputStream.java (working copy)
@@ -1,5 +1,5 @@
/* InflaterInputStream.java - Input stream filter for decompressing
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -153,8 +153,10 @@
len = in.read(buf, 0, buf.length);
- if (len >= 0)
- inf.setInput(buf, 0, len);
+ if (len < 0)
+ throw new ZipException("Deflated stream ends early.");
+
+ inf.setInput(buf, 0, len);
}
/**