mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Cast fstat values to i64 to prevent 32 bit overflows.
This commit is contained in:
parent
e138fa77ff
commit
19ef7298c8
2
lrzip.c
2
lrzip.c
|
|
@ -467,7 +467,7 @@ void decompress_file(rzip_control *control)
|
|||
* decompressed file. */
|
||||
if (unlikely(fstatvfs(fd_out, &fbuf)))
|
||||
fatal("Failed to fstatvfs in decompress_file\n");
|
||||
free_space = fbuf.f_bsize * fbuf.f_bavail;
|
||||
free_space = (i64)fbuf.f_bsize * (i64)fbuf.f_bavail;
|
||||
if (free_space < expected_size) {
|
||||
if (FORCE_REPLACE)
|
||||
print_err("Warning, inadequate free space detected, but attempting to decompress due to -f option being used.\n");
|
||||
|
|
|
|||
2
rzip.c
2
rzip.c
|
|
@ -795,7 +795,7 @@ void rzip_fd(rzip_control *control, int fd_in, int fd_out)
|
|||
* uncompressed file. */
|
||||
if (unlikely(fstatvfs(fd_out, &fbuf)))
|
||||
fatal("Failed to fstatvfs in compress_file\n");
|
||||
free_space = fbuf.f_bsize * fbuf.f_bavail;
|
||||
free_space = (i64)fbuf.f_bsize * (i64)fbuf.f_bavail;
|
||||
if (free_space < control->st_size) {
|
||||
if (FORCE_REPLACE)
|
||||
print_err("Warning, possibly inadequate free space detected, but attempting to compress due to -f option being used.\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue