[
https://issues.apache.org/jira/browse/COMPRESS-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17116733#comment-17116733
]
Peter Lee commented on COMPRESS-530:
------------------------------------
Fix in commit #ae0a15cc301e827a6139af03bfe911c2f919a47c
> Tar decompression fails with NegativeArraySizeException
> -------------------------------------------------------
>
> Key: COMPRESS-530
> URL: https://issues.apache.org/jira/browse/COMPRESS-530
> Project: Commons Compress
> Issue Type: Bug
> Reporter: Maksim Zuev
> Priority: Major
> Attachments: NegativeArraySizeException.tar
>
>
> This Kotlin code fails with exception(NegativeArraySizeException.tar is in
> the attachment)
> Exception in thread "main" java.lang.NegativeArraySizeException: -5332783
> at
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.parsePaxHeaders(TarArchiveInputStream.java:703)
> at
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.paxHeaders(TarArchiveInputStream.java:555)
> at
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:404)
> at
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:799)
> at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt:31)
> at ru.example.kotlinfuzzer.tests.MainKt.main(main.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import java.io.File
> fun main() {
> val tar = File("NegativeArraySizeException.tar")
> ArchiveStreamFactory().createArchiveInputStream("tar",
> tar.inputStream()).use { ais ->
> ais.nextEntry
> ais.readAllBytes()
> }
> }
> {code}
> IOException expected
--
This message was sent by Atlassian Jira
(v8.3.4#803005)