Patch: bug fix in ZipOutputStream

Tom Tromey tromey@cygnus.com
Tue Feb 29 09:04:00 GMT 2000


I'm committing the appended patch.  It fixes a bug in ZipOutputStream.
In some situations, ZipOutputStream.write_entry could be called when
`current == null'.  Thanks to Mo for catching it.

2000-02-28  Mo DeJong  <mdejong@cygnus.com>

	* java/util/zip/ZipOutputStream.java(write_entry) : Fixed
	SIGSEV caused by use of the wrong instance variable.

Tom

Index: java/util/zip/ZipOutputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/ZipOutputStream.java,v
retrieving revision 1.4
diff -u -r1.4 ZipOutputStream.java
--- ZipOutputStream.java	2000/01/19 18:39:27	1.4
+++ ZipOutputStream.java	2000/02/29 17:02:34
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Red Hat, Inc.
+/* Copyright (C) 1999, 2000  Red Hat, Inc.
 
    This file is part of libgcj.
 
@@ -104,8 +104,8 @@
 
     boolean crc_after = false;
     if (is_local
-	&& (current.getCrc() == -1 || current.getCompressedSize() == -1
-	    || current.getSize() == -1))
+	&& (entry.getCrc() == -1 || entry.getCompressedSize() == -1
+	    || entry.getSize() == -1))
       crc_after = true;
     // For the bits field we always indicate `normal' compression,
     // even if that isn't true.


More information about the Java-patches mailing list