You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebastian Schuberth (Jira)" <ji...@apache.org> on 2023/06/14 14:20:00 UTC
[jira] [Created] (COMPRESS-645) TarArchiveInputStream accepts any files
Sebastian Schuberth created COMPRESS-645:
--------------------------------------------
Summary: TarArchiveInputStream accepts any files
Key: COMPRESS-645
URL: https://issues.apache.org/jira/browse/COMPRESS-645
Project: Commons Compress
Issue Type: Bug
Components: Archivers
Affects Versions: 1.23.0
Reporter: Sebastian Schuberth
I realized that iterating over a {{TarArchiveInputStream}} via {{getNextEntry}} does not throw if an arbitrary non-TAR file (or a compressed TAR, like {{.tar.gz}}) feeds the stream. Instead, simply the first call to {{getNextEntry}} return null. This means one cannot distinguish between an empty TAR file and a non-TAR file this way. And this behavior is in contrast to the other {{*ArchiveInputStream}} implementations which *do* throw if the file behind the stream is not of the supported type.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)