JavaNativeMethodImpl_OpenJDK6.st
branchdevelopment
changeset 2547 ead869f48c58
parent 2476 d24ce8174195
child 2549 6ef03f1baa82
--- a/JavaNativeMethodImpl_OpenJDK6.st	Tue Apr 23 00:47:30 2013 +0100
+++ b/JavaNativeMethodImpl_OpenJDK6.st	Tue Apr 23 00:54:23 2013 +0100
@@ -13629,12 +13629,12 @@
 
     | path  mode  lastModTime  result |
 
+    a1 isNil ifTrue: [ JavaVM throwZipException ].
     path := Java as_ST_String: a1.
     "/(path endsWith:'.jar') ifFalse:[self breakPoint: #jv].
     mode := a2.
     lastModTime := a3.
     result := path asFilename.
-    result ifNil: [ JavaVM throwZipException ].
     ^[
         | i zar |
 
@@ -13642,6 +13642,9 @@
             ZipCacheLastAccessed closeFile.
         ].
         zar := ZipArchive readingFrom: result readStream.
+        zar checkZipArchive ifFalse:[
+            JavaVM throwZipException:'Cannot open zip file: not a zip archive'.
+        ].
         i := ZipCache indexOf: nil.
         i ~~ 0 ifTrue:[
             ZipCache at: i put: zar.
@@ -13655,7 +13658,7 @@
     ]
 
     "Modified: / 01-04-2011 / 15:35:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
-    "Modified: / 11-02-2013 / 12:36:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 23-04-2013 / 00:52:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _java_util_zip_ZipFile_read: this _:a1 _: a2 _: a3 _: a4 _: a5 _: a6 _: a7 _: a8 _: a9