]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
bzip2: Remove dead code 3082/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 27 May 2026 19:19:09 +0000 (21:19 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 27 May 2026 19:19:09 +0000 (21:19 +0200)
The check for end of file (avail == 0) happens after the check for a
NULL return value of __archive_read_filter_ahead.

Remove it, because at this stage, it's definitely truncated, not just
end of file.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_read_support_filter_bzip2.c

index dc9d24d87702ad759fcdb058aa4775a36bd98511..02d6f3772e3825f8d58f85b2e864f0684980ee69 100644 (file)
@@ -298,14 +298,6 @@ bzip2_filter_read(struct archive_read_filter *self, const void **p)
                if (ret > max_in)
                        ret = max_in;
                state->stream.avail_in = (uint32_t)ret;
-               /* There is no more data, return whatever we have. */
-               if (ret == 0) {
-                       state->eof = 1;
-                       *p = state->out_block;
-                       decompressed = state->stream.next_out
-                           - state->out_block;
-                       return (decompressed);
-               }
 
                /* Decompress as much as we can in one pass. */
                ret = BZ2_bzDecompress(&(state->stream));