]> git.ipfire.org Git - thirdparty/libarchive.git/commit
tar: Always treat negative sizes as error 2644/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 27 May 2025 18:30:01 +0000 (20:30 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 27 May 2025 18:46:51 +0000 (20:46 +0200)
commit33d35287236d98f96565c3ba7c8a3ea4fa296581
tree74899624b6c1d50bb14791443c6e5e0b1a0e1486
parent6389d172ed25de1b84606716553241c171a30111
tar: Always treat negative sizes as error

If a pax global header specifies a negative size, it is possible to
reduce variable `unconsumed` by 512 bytes, leading to a re-reading
of the pax global header. Fortunately the loop verifies that only one
global header per entry is allowed, leading to a later ARCHIVE_FATAL.

Avoid any form of negative size handling and fail early.

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