Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-129

"java.io.EOFException: Truncated ZIP entry: <some entry>"- while extracting a zip file that contains a entry which lager than 2 GB (Integer#MAX_VALUE)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Component/s: Archivers
    • Labels:
      None
    • Environment:

      Ubuntu 10; java 6 of sun

      Description

      Issue:
      "java.io.EOFException: Truncated ZIP entry: <some entry>" will be threw while extracting a zip file that contains a entry with size larger than Integer#MAX_VALUE bytes (about 2 GB). After the big entry has been read, then try to get next entry by calling ZipArchiveInputStream#getNextZipEntry(), and it throws that EOFException.

      Cause:
      before getting next zip entry, ZipArchiveInputStream tries to close the current entry and in the close- method it use the field "bytesReadFromStream" to ensure all entry bytes are read, however the field "bytesReadFromStream" is a integer, that means it is already overflowed and it leads to a false ensure result.

      Solution suggestion:
      instead integer using long for "bytesReadFromStream" and possibly for "readBytesOfEntry" too.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              twang8341 tinghui wang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: