You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Aditya Prasad (Jira)" <ji...@apache.org> on 2020/07/13 20:43:00 UTC

[jira] [Updated] (COMPRESS-544) TarArchiveInputStream#getNextTarEntry does not fail on truncated archive

     [ https://issues.apache.org/jira/browse/COMPRESS-544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aditya Prasad updated COMPRESS-544:
-----------------------------------
    Description: 
The following should throw IOException when given a truncated tar:
{code:java}
TarArchiveInputStream tarInput = new TarArchiveInputStream(inputStream);
TarArchiveEntry currentEntry;
while ((currentEntry = tarInput.getNextTarEntry()) != null) {
}
{code}
Instead, it completes successfully. I've included a small simple .tar, and a truncated version of it. Untaring from the command line fails properly:
{code:java}
$ tar -tf test_truncated.tar
test/
tar: Truncated tar archive
tar: Error exit delayed from previous errors.{code}

  was:
The following should throw IOException when given a truncated tar:

 
{code:java}
TarArchiveInputStream tarInput = new TarArchiveInputStream(inputStream);
TarArchiveEntry currentEntry;
while ((currentEntry = tarInput.getNextTarEntry()) != null) {
}
{code}
Instead, it completes successfully. I've included a small simple .tar, and a truncated version of it. Untaring from the command line fails properly:
{code:java}
$ tar -tf test_truncated.tar
test/
tar: Truncated tar archive
tar: Error exit delayed from previous errors.{code}


> TarArchiveInputStream#getNextTarEntry does not fail on truncated archive
> ------------------------------------------------------------------------
>
>                 Key: COMPRESS-544
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-544
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Archivers
>    Affects Versions: 1.20
>            Reporter: Aditya Prasad
>            Priority: Minor
>         Attachments: test.tar, test_truncated.tar
>
>
> The following should throw IOException when given a truncated tar:
> {code:java}
> TarArchiveInputStream tarInput = new TarArchiveInputStream(inputStream);
> TarArchiveEntry currentEntry;
> while ((currentEntry = tarInput.getNextTarEntry()) != null) {
> }
> {code}
> Instead, it completes successfully. I've included a small simple .tar, and a truncated version of it. Untaring from the command line fails properly:
> {code:java}
> $ tar -tf test_truncated.tar
> test/
> tar: Truncated tar archive
> tar: Error exit delayed from previous errors.{code}



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