Aditya Prasad created COMPRESS-544:
--------------------------------------
Summary: 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
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)