]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Improve lseek handling (#2564)
authorTobias Stoeckmann <stoeckmann@users.noreply.github.com>
Sun, 6 Apr 2025 20:34:37 +0000 (22:34 +0200)
committerGitHub <noreply@github.com>
Sun, 6 Apr 2025 20:34:37 +0000 (13:34 -0700)
commit89b8c35ff4b5addc08a85bf5df02b407f8af1f6c
tree0158f6bb8cac6fda1c15b4aa8e14ec2f4c0379ba
parentfed3712d6ef28c36213eda016ebea5c1ef525f72
Improve lseek handling (#2564)

The skip functions are limited to 1 GB for cases in which libarchive
runs on a system with an off_t or long with 32 bits. This has negative
impact on 64 bit systems.

Instead, make sure that _all_ subsequent functions truncate properly.
Some of them already did and some had regressions for over 10 years.

Tests pass on Debian 12 i686 configured with --disable-largefile, i.e.
running with an off_t with 32 bits.

Casts added where needed to still pass MSVC builds.

---------

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_read.c
libarchive/archive_read_disk_posix.c
libarchive/archive_read_open_fd.c
libarchive/archive_read_open_file.c
libarchive/archive_read_open_filename.c
libarchive/test/read_open_memory.c
libarchive/test/test_sparse_basic.c
libarchive/test/test_tar_large.c