diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 64df6b69ba7..bde6b45470e 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2006-03-09 Tom Tromey + + PR libgcj/24461: + * java/util/zip/InflaterInputStream.java (fill): Throw exception + if stream is truncated. + 2006-03-09 Tom Tromey * win32.cc (_Jv_platform_nanotime): New function. diff --git a/libjava/java/util/zip/InflaterInputStream.java b/libjava/java/util/zip/InflaterInputStream.java index 69b3ecdfc18..11b06d24a28 100644 --- a/libjava/java/util/zip/InflaterInputStream.java +++ b/libjava/java/util/zip/InflaterInputStream.java @@ -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 @@ public class InflaterInputStream extends FilterInputStream 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); } /**