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

Allow ZipInputStream.readEnd to parse small Zip64 ZIP files

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 23
    • 21
    • core-libs
    • None
    • b10
    • generic
    • generic

    Description

      ZipInputStream.readEnd currently expects 8-byte size and csize fields in the data descriptor header if and only if the actually numbers of compressed or uncompressed bytes exceeds the Zip64 limit of 0XFFFFFFFF.

      This prevents parsing of small zip64 entries, such as the ones created using:

      echo hello | zip -fd > hello.zip

      The APPNOTE.txt specification indicates that such files are valid, so ZipInputStream should be able to parse them:

      When extracting, if the zip64 extended information extra
      field is present for the file the compressed and
      uncompressed sizes will be 8 byte values.

      The solution is to update ZipOutputStream.readEnd to check for the presence of Zip64 extra information fields in the LOC.

      Attachments

        Issue Links

          Activity

            People

              eirbjo Eirik Bjørsnøs
              eirbjo Eirik Bjørsnøs
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: