Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-546

Decompression fails with NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.20
    • None
    • None
    • None

    Description

      This Kotlin code fails with exception(NullPointerException.zip is in the attachments)
      Exception in thread "main" java.lang.NullPointerExceptionException in thread "main" java.lang.NullPointerException at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.processZip64Extra(ZipArchiveInputStream.java:424) at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.getNextZipEntry(ZipArchiveInputStream.java:347) 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)

      import org.apache.commons.compress.archivers.ArchiveStreamFactory
      import java.io.ByteArrayInputStream
      import java.io.File
      
      fun main() {
          val bytes = File("NullPointerException.zip").readBytes()
          val input = ByteArrayInputStream(bytes)
          ArchiveStreamFactory().createArchiveInputStream("zip", input).use { ais ->
              ais.nextEntry
              ais.readAllBytes()
          }
      }
      

      Expected some other exception as IOException is the only declared.

       

      Attachments

        1. NullPointerException.zip
          0.1 kB
          Maksim Zuev

        Activity

          People

            Unassigned Unassigned
            zuevmaxim Maksim Zuev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: