summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2007-10-27 22:45:40 +0000
committerkientzle <kientzle@FreeBSD.org>2007-10-27 22:45:40 +0000
commit7fc8683d7c83bb69df243cbfe44ac47d3bf7aff0 (patch)
treea4caafd3e2e07d388e490dc75c6aa1e75816969e /lib
parent8e5ba8950a1be7f42f4a078942a087451e77f974 (diff)
downloadFreeBSD-src-7fc8683d7c83bb69df243cbfe44ac47d3bf7aff0.zip
FreeBSD-src-7fc8683d7c83bb69df243cbfe44ac47d3bf7aff0.tar.gz
When skipping input data, don't overflow a 32-bit size_t.
This can only happen on 32-bit systems when you're reading an uncompressed archive and the skip request is an exact multiple of 4G (e.g., skipping a tar entry with an 8G body). The symptom is that the read_ahead() ends up returning zero bytes, and the extraction stops with a premature end-of-file. Using '1' here is more correct anyway, as it allows read_ahead() to function opportunistically and minimize copying. MFC after: 5 days
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_read_support_compression_none.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_support_compression_none.c b/lib/libarchive/archive_read_support_compression_none.c
index 07368b2..99586c0 100644
--- a/lib/libarchive/archive_read_support_compression_none.c
+++ b/lib/libarchive/archive_read_support_compression_none.c
@@ -334,7 +334,7 @@ archive_decompressor_none_skip(struct archive_read *a, off_t request)
const void* dummy_buffer;
ssize_t bytes_read;
bytes_read = archive_decompressor_none_read_ahead(a,
- &dummy_buffer, request);
+ &dummy_buffer, 1);
if (bytes_read < 0)
return (bytes_read);
if (bytes_read == 0) {
OpenPOWER on IntegriCloud