commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COMPRESS-223) NPE from TarBuffer.tryToConsumeSecondEOFRecord
Date Wed, 17 Apr 2013 15:41:16 GMT

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

Sebb commented on COMPRESS-223:
-------------------------------

The problem seems to be caused by TarBuffer.readRecord() which can return null if at EOF.
This is not documented...
                
> NPE from TarBuffer.tryToConsumeSecondEOFRecord
> ----------------------------------------------
>
>                 Key: COMPRESS-223
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-223
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Archivers
>    Affects Versions: 1.5
>            Reporter: Jeremy Gustie
>         Attachments: TarArchiveInputStream.java.patch, TarBuffer.java.patch
>
>
> I get an NPE using {{Lister}} on the decompressed 
> [Xerces-J-bin.2.5.0.tar.gz|http://archive.apache.org/dist/xml/xerces-j/Xerces-J-bin.2.5.0.tar.gz]
archive.
> Wrapping the {{for}} loop in {{TarBuffer.isEOFRecord}} with a {{null}} check would fix
the issue; it would also clean up the {{TarArchiveInputStream.getRecord}} implementation a
little.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message