JarFile.java (verifyHashes): Check whether ZipEntry exists.
authorMark Wielaard <mark@klomp.org>
Mon, 21 Feb 2005 20:29:00 +0000 (20:29 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Mon, 21 Feb 2005 20:29:00 +0000 (20:29 +0000)
       * java/util/jar/JarFile.java (verifyHashes): Check whether ZipEntry
       exists.

From-SVN: r95347

libjava/ChangeLog
libjava/java/util/jar/JarFile.java

index 7d869d5..1c141df 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-21  Mark Wielaard  <mark@klomp.org>
+
+       * java/util/jar/JarFile.java (verifyHashes): Check whether ZipEntry
+       exists.
+
 2005-02-21  Andrew Haley  <aph@redhat.com>
 
        * Makefile.in: Rebuilt.
index c66881f..cb2cbf4 100644 (file)
@@ -726,7 +726,14 @@ public class JarFile extends ZipFile
     byte[] entryBytes = null;
     try
       {
-        entryBytes = readManifestEntry(super.getEntry(entry));
+       ZipEntry e = super.getEntry(entry);
+       if (e == null)
+         {
+           if (DEBUG)
+             debug("verifyHashes: no entry '" + entry + "'");
+           return false;
+         }
+        entryBytes = readManifestEntry(e);
       }
     catch (IOException ioe)
       {