Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8186464

ZipFile cannot read some InfoZip ZIP64 zip files

    Details

      Description

      ZIP64 zip files created by InfoZip with large entries cannot be read by ZipFile.

       $ for f in OpenZip.java Makefile; do echo --- $f ---; cat $f; done; echo ---; make
      --- OpenZip.java ---
      public class OpenZip {
          public static void main(String[] args) throws Throwable {
              new java.util.zip.ZipFile(args[0]);
          }
      }
      --- Makefile ---
      FILE = bigfile
      ZIP = bigfile.zip
      JDK = ~/jdk/jdk10
      all:
      fallocate -l 5G $(FILE); zip $(ZIP) $(FILE); zipinfo -t $(ZIP); $(JDK)/bin/javac OpenZip.java; $(JDK)/bin/java OpenZip $(ZIP); rm -f $(FILE) $(ZIP)
      ---
      fallocate -l 5G bigfile; zip bigfile.zip bigfile; zipinfo -t bigfile.zip; ~/jdk/jdk10/bin/javac OpenZip.java; ~/jdk/jdk10/bin/java OpenZip bigfile.zip; rm -f bigfile bigfile.zip
        adding: bigfile (deflated 100%)
      1 file, 5368709120 bytes uncompressed, 5210192 bytes compressed: 99.9%
      Exception in thread "main" java.util.zip.ZipException: invalid CEN header (bad signature)
      at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1252)
      at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1212)
      at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:997)
      at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:960)
      at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:216)
      at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:148)
      at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:119)
      at OpenZip.main(OpenZip.java:3)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sherman Xueming Shen
                Reporter:
                martin Martin Buchholz
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: