You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Stefan Bodewig (Jira)" <ji...@apache.org> on 2020/05/23 20:01:00 UTC
[jira] [Resolved] (COMPRESS-523) Decompression fails with
IllegalArgumentException
[ https://issues.apache.org/jira/browse/COMPRESS-523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Bodewig resolved COMPRESS-523.
-------------------------------------
Resolution: Fixed
fixed with commit 2ea0e464
> Decompression fails with IllegalArgumentException
> -------------------------------------------------
>
> Key: COMPRESS-523
> URL: https://issues.apache.org/jira/browse/COMPRESS-523
> Project: Commons Compress
> Issue Type: Bug
> Affects Versions: 1.20
> Reporter: Maksim Zuev
> Priority: Major
> Fix For: 1.21
>
>
> This Kotlin code fails with exception
> Exception in thread "main" java.lang.IllegalArgumentException
> at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.realSkip(ZipArchiveInputStream.java:1120)
> at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.skipRemainderOfArchive(ZipArchiveInputStream.java:1054)
> at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextZipEntry(ZipArchiveInputStream.java:283)
> at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextEntry(ZipArchiveInputStream.java:435)
> at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:15)
> at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.ByteArrayInputStream
> fun main() {
> val bytes = listOf(
> 0x50, 0x4b, 0x01, 0x02, 0x14, 0x00, 0x14, 0x00, 0x08, 0x00,
> 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0xbe, 0x00, 0x00,
> 0x00, 0xb7, 0xe8, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00
> ).map { it.toByte() }.toByteArray()
> val input = ByteArrayInputStream(bytes)
> ArchiveStreamFactory().createArchiveInputStream("zip", input).use { ais ->
> ais.nextEntry
> ais.readAllBytes()
> }
> }
> {code}
> IOException expected.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)