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

ZipArchiveInputStream: ArrayIndexOutOfBoundsException when extracting a STORED zip file entry from within a zip.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.1
    • 1.5
    • Archivers
    • None
    • Windows (Linux as well)

    Description

      When trying to read out a ZIP file, that has been stored (Method STORE, not DEFLATE!, with DEFLATE it seems OK) in another ZIP file using the ZipArchiveInputStream, I do get an ArrayIndexOutOfBoundsException when doing the arraycopy in ZipArchiveInputStream#readStored(byte[], int, int) (line 362) because the "toRead" is not decreased by the buf.offsetInBuffer.

      I will add the zip in question as attachment.

      Attachments

        1. compress-219-test.patch
          2 kB
          Stefan Bodewig
        2. test-linux.zip
          2 kB
          Wurstbrot mit Senf
        3. ZipArchiveInputStreamTest.java
          1 kB
          Wurstbrot mit Senf

        Activity

          People

            Unassigned Unassigned
            wurstbrot Wurstbrot mit Senf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: