[jira] [Commented] (COMPRESS-219) ZipArchiveInputStream: ArrayIndexOutOfBoundsException when extracting a STORED zip file entry from within a zip.
[ https://issues.apache.org/jira/browse/COMPRESS-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13583100#comment-13583100 ] Wurstbrot mit Senf commented on COMPRESS-219: - Yes, of course you can include it. It does not contain any sensitive data, in fact, no data at all :-) 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 Fix For: 1.5 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
[jira] [Commented] (COMPRESS-219) ZipArchiveInputStream: ArrayIndexOutOfBoundsException when extracting a STORED zip file entry from within a zip.
[ https://issues.apache.org/jira/browse/COMPRESS-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13582250#comment-13582250 ] Wurstbrot mit Senf commented on COMPRESS-219: - 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 :-(): @Test public static void shouldReadNestedZip() throws Exception { final Path outDir = Files.createDirectories(Paths.get(dir)); try (ZipArchiveInputStream in = new ZipArchiveInputStream(Files.newInputStream(Paths.get(COMPRESS-219.zip)));) { extractZipInputStream(outDir, in); } finally { FileUtils.deleteDirectory(outDir.toFile()); } } private static void extractZipInputStream(final Path outDir, final ZipArchiveInputStream in) throws IOException { ZipArchiveEntry zae = in.getNextZipEntry(); while (zae != null) { if (zae.getName().endsWith(.zip)) { final Path outFile = outDir.resolve(Paths.get(zae.getName().replace(^/, ))); Files.createDirectories(outFile); final ZipArchiveInputStream zipInZip = new ZipArchiveInputStream(in); extractZipInputStream(outFile, zipInZip); } zae = in.getNextZipEntry(); } } 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 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
[jira] [Commented] (COMPRESS-219) ZipArchiveInputStream: ArrayIndexOutOfBoundsException when extracting a STORED zip file entry from within a zip.
[ https://issues.apache.org/jira/browse/COMPRESS-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13582421#comment-13582421 ] Stefan Bodewig commented on COMPRESS-219: - I can't use NIO2 in a Java5 codebase, but I managed to reproduce the bug now :-) Can I include your test zip in compress' source tree or does it contain sensitive information? 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
[jira] [Commented] (COMPRESS-219) ZipArchiveInputStream: ArrayIndexOutOfBoundsException when extracting a STORED zip file entry from within a zip.
[ https://issues.apache.org/jira/browse/COMPRESS-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13582447#comment-13582447 ] Stefan Bodewig commented on COMPRESS-219: - fixed with svn revision 1448357 - Thanks! I'll leave this ticket open until I know whether I can enable the test. 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