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
This commit is contained in:
parent
5dfb7ce5fc
commit
c383d82e4d
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user