[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch #1831] [Patch #1831] bug compatibility with sun for ZipInputStrea
From: |
noreply |
Subject: |
[patch #1831] [Patch #1831] bug compatibility with sun for ZipInputStream |
Date: |
Sat, 16 Aug 2003 04:45:47 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686) Gecko/20030714 Galeon/1.3.7 Debian/1.3.7.20030813-1 |
Patch #1831 has been updated.
Project:
Category: None
Status: Open
Summary: bug compatibility with sun for ZipInputStream
Follow-Ups:
Date: Sat 08/16/03 at 10:36
By: mark
Comment:
You return null, but don't call close(). Does that mean that you can just try
and keep calling getNextEntry() till the zip stream is "in sync" again?
Do you have an example zip file and/or code that shows what goes wrong/should
happen in this case?
P.S. Please just remove old code. Commenting it out makes the patch more
confusing and the old code will show up in the diff/patch anyway.
-------------------------------------------------------
Date: Sat 08/16/03 at 10:45
By: mark
Comment:
My suggestion would be the following patch. But I don't know if that is really
what you are after.
diff -u -r1.12 ZipInputStream.java
--- java/util/zip/ZipInputStream.java 18 Jun 2003 09:42:57 -0000 1.12
+++ java/util/zip/ZipInputStream.java 16 Aug 2003 08:43:44 -0000
@@ -151,9 +151,17 @@
close();
return null;
}
+
if (header != LOCSIG)
- throw new ZipException("Wrong Local header signature: "
- + Integer.toHexString(header));
+ {
+ // Stream gone bad.
+ // We could throw a ZipException, but just closing the stream is
+ // easier to handle by most applications and seems to be done by
+ // other implementations.
+ close();
+ return null;
+ }
+
/* skip version */
readLeShort();
flags = readLeShort();
-------------------------------------------------------
-------------------------------------------------------
For more info, visit:
http://savannah.gnu.org/patch/?func=detailpatch&patch_id=1831&group_id=85
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/