commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Lee (Jira)" <j...@apache.org>
Subject [jira] [Commented] (COMPRESS-554) Tar decompression fails with NullPointerException
Date Tue, 01 Sep 2020 07:06:00 GMT

    [ https://issues.apache.org/jira/browse/COMPRESS-554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17188187#comment-17188187
] 

Peter Lee commented on COMPRESS-554:
------------------------------------

I think [~zuevmaxim] is expecting a checked exception instead of an undeclared exception.

Thank you for your reporting [~zuevmaxim] . I'm interested in how you succeed to find so
many similiar problems in Compress? Are you running a fuzzing test? Or you just read the code
and found these problems? :)

 

> Tar decompression fails with NullPointerException
> -------------------------------------------------
>
>                 Key: COMPRESS-554
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-554
>             Project: Commons Compress
>          Issue Type: Bug
>    Affects Versions: 1.20, 1.21
>            Reporter: Maksim Zuev
>            Priority: Major
>         Attachments: NPE.tar
>
>
> This Kotlin code fails with exception(NPE.tar is in the attachments)
> Exception in thread "main" java.lang.NullPointerExceptionException in thread "main" java.lang.NullPointerException
at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:424)
at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextEntry(TarArchiveInputStream.java:858)
at kotlinx.fuzzer.tests.apache.tar.ApacheTarTestKt.main(ApacheTarTest.kt:79) at kotlinx.fuzzer.tests.apache.tar.ApacheTarTestKt.main(ApacheTarTest.kt)
> {code:java}
> import org.apache.commons.compress.archivers.ArchiveStreamFactory
> import org.apache.commons.compress.archivers.tar.TarArchiveEntry
> import java.io.File
> import java.io.FileInputStream
> fun main() {
>     FileInputStream(File("NPE.tar")).use { fis ->
>         ArchiveStreamFactory().createArchiveInputStream("tar", fis).use { ais ->
>             var zae = ais.nextEntry as TarArchiveEntry?
>             while (zae != null) {
>                 ais.readAllBytes()
>                 zae = ais.nextEntry as TarArchiveEntry?
>             }
>         }
>     }
> }
> {code}



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

Mime
View raw message