[ https://issues.apache.org/jira/browse/COMPRESS-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13582250#comment-13582250 ]
Wurstbrot mit Senf edited comment on COMPRESS-219 at 2/20/13 3:59 PM: ---------------------------------------------------------------------- What you did in the test, works: you wrote the stream to a file, i.e. you actually copied the internal zip to the file. What causes the problem is the actual deflating of the zip within the zip. That is: creating a new ZipArchiveInputStream from the ZipArchiveInputStream like in the following snippet (I rewrote your code a bit for NIO.2, sorry for that :-() so it reproduces the error and attached it to the issue. was (Author: wurstbrot): What you did in the test, works: you wrote the stream to a file, i.e. you actually copied the internal zip to the file. What causes the problem is the actuall deflating of the zip within the zip. That is: creating a new ZipArchiveInputStream from the ZipArchiveInputStream like in the following snippet (I rewrote your code for NIO.2, sorry for that :-() and attached it to the issue. > ZipArchiveInputStream: ArrayIndexOutOfBoundsException when extracting a > STORED zip file entry from within a zip. > ---------------------------------------------------------------------------------------------------------------- > > Key: COMPRESS-219 > URL: https://issues.apache.org/jira/browse/COMPRESS-219 > Project: Commons Compress > Issue Type: Bug > Components: Archivers > Affects Versions: 1.4.1 > Environment: Windows (Linux as well) > Reporter: Wurstbrot mit Senf > Priority: Minor > Attachments: compress-219-test.patch, test-linux.zip, > ZipArchiveInputStreamTest.java > > > 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. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira