PR 8234: ZipInputStream chokes when InputStream.read() returns small chunks
Tom Tromey
tromey@redhat.com
Tue Oct 15 21:38:00 GMT 2002
>>>>> "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;
}
More information about the Java-patches
mailing list