This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PR 8234: ZipInputStream chokes when InputStream.read() returns small chunks
- From: Tom Tromey <tromey at redhat dot com>
- To: Adam Megacz <gcj at lists dot megacz dot com>
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 15 Oct 2002 22:33:09 -0600
- Subject: Re: PR 8234: ZipInputStream chokes when InputStream.read() returns small chunks
- References: <861y6rsbrz.fsf@nowhere.com>
- Reply-to: tromey at redhat dot com
>>>>> "Adam" == Adam Megacz <gcj@lists.megacz.com> writes:
Adam> Conclusive proof that java.util.zip is broken.
Try the appended. I'm running it through the test suite now. It
fixed the bug you're seeing.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
Fix for PR libgcj/8234:
* java/util/zip/natInflater.cc (reset): Reset avail_in.
* java/util/zip/natDeflater.cc (reset): Reset avail_in.
Index: java/util/zip/natDeflater.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/zip/natDeflater.cc,v
retrieving revision 1.8
diff -u -r1.8 natDeflater.cc
--- java/util/zip/natDeflater.cc 15 Jun 2002 18:31:13 -0000 1.8
+++ java/util/zip/natDeflater.cc 16 Oct 2002 04:34:48 -0000
@@ -124,6 +124,7 @@
z_streamp s = (z_streamp) zstream;
// Just ignore errors.
deflateReset (s);
+ s->avail_in = 0;
flush_flag = 0;
is_finished = false;
}
Index: java/util/zip/natInflater.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/zip/natInflater.cc,v
retrieving revision 1.10
diff -u -r1.10 natInflater.cc
--- java/util/zip/natInflater.cc 15 Jun 2002 18:31:13 -0000 1.10
+++ java/util/zip/natInflater.cc 16 Oct 2002 04:34:48 -0000
@@ -149,6 +149,7 @@
z_streamp s = (z_streamp) zstream;
// Just ignore errors.
inflateReset (s);
+ s->avail_in = 0;
is_finished = false;
dict_needed = false;
}