You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Peter Lee (Jira)" <ji...@apache.org> on 2020/10/07 02:31:00 UTC

[jira] [Updated] (COMPRESS-547) Decompression fails with IllegalArgumentException

     [ https://issues.apache.org/jira/browse/COMPRESS-547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Lee updated COMPRESS-547:
-------------------------------
    Fix Version/s:     (was: 1.20)
                   1.21

> Decompression fails with IllegalArgumentException
> -------------------------------------------------
>
>                 Key: COMPRESS-547
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-547
>             Project: Commons Compress
>          Issue Type: Bug
>            Reporter: Maksim Zuev
>            Assignee: Peter Lee
>            Priority: Major
>             Fix For: 1.21
>
>         Attachments: IllegalArgumentException.zip
>
>
> This Kotlin code fails with exception(IllegalArgumentException.zipĀ is in the attachments)
> Exception in thread "main" java.lang.IllegalArgumentException: 29 > 0 at java.base/java.util.Arrays.copyOfRange(Arrays.java:4029) at org.apache.commons.compress.archivers.zip.X0017_StrongEncryptionHeader.parseFileFormat(X0017_StrongEncryptionHeader.java:345) at org.apache.commons.compress.archivers.zip.X0017_StrongEncryptionHeader.parseFromLocalFileData(X0017_StrongEncryptionHeader.java:410) at org.apache.commons.compress.archivers.zip.ExtraFieldUtils.fillExtraField(ExtraFieldUtils.java:324) at org.apache.commons.compress.archivers.zip.ZipArchiveEntry$ExtraFieldParsingMode.fillAndMakeUnrecognizedOnError(ZipArchiveEntry.java:1219) at org.apache.commons.compress.archivers.zip.ZipArchiveEntry$ExtraFieldParsingMode.access$100(ZipArchiveEntry.java:1127) at org.apache.commons.compress.archivers.zip.ZipArchiveEntry$ExtraFieldParsingMode$1.fill(ZipArchiveEntry.java:1142) at org.apache.commons.compress.archivers.zip.ExtraFieldUtils.parse(ExtraFieldUtils.java:214) at org.apache.commons.compress.archivers.zip.ZipArchiveEntry.setExtra(ZipArchiveEntry.java:675) at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextZipEntry(ZipArchiveInputStream.java:341) at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextEntry(ZipArchiveInputStream.java:435) at kotlinx.fuzzer.tests.apache.zip.ApacheZipTestKt.main(ApacheZipTest.kt:85) at kotlinx.fuzzer.tests.apache.zip.ApacheZipTestKt.main(ApacheZipTest.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.ByteArrayInputStream
> import java.io.File
> fun main() {
>     val bytes = File("IllegalArgumentException.zip").readBytes()
>     val input = ByteArrayInputStream(bytes)
>     ArchiveStreamFactory().createArchiveInputStream("zip", input).use { ais ->
>         ais.nextEntry
>         ais.readAllBytes()
>     }
> }
> {code}
> Expected some other exception as IOException is the only declared.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)