diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-07-09 19:39:49 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-07-09 19:51:43 +0200 |
commit | 729850cf514be9052c804874ed09ac75d3c45eea (patch) | |
tree | 22a15e49a1204f0a6681d5bd38f0ce98de3d75b0 /bin | |
parent | 531d77736ece1398be75cf9b191a06b2e51f6304 (diff) |
tar2sqfs: Fix integer truncation issue when appending data to a tarball
The data is processed 2G at a time to avoid this exact issue, but the
check was skipped on 64 bit systems, since the function *used to* use
size_t instead of sqfs_u32.
This commit removes the second check.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/tar2sqfs/process_tarball.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/tar2sqfs/process_tarball.c b/bin/tar2sqfs/process_tarball.c index 1118822..8465760 100644 --- a/bin/tar2sqfs/process_tarball.c +++ b/bin/tar2sqfs/process_tarball.c @@ -48,7 +48,7 @@ static int write_file(istream_t *input_file, sqfs_writer_t *sqfs, diff = filesize - offset; } - if (sizeof(diff) > sizeof(size_t) && diff > 0x7FFFFFFFUL) + if (diff > 0x7FFFFFFFUL) diff = 0x7FFFFFFFUL; if (sparse_region) { |