mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Fix 'Failed to malloc ckbuf in hash_search2' with very large files.
lrzip was trying to malloc() enough memory to fit the entire length of file it was going to hash, instead of just the size of one chunk. This caused problems when combined with extremely large files.
This commit is contained in:
parent
6c8525893b
commit
2e1fc25543
2
rzip.c
2
rzip.c
|
|
@ -745,7 +745,7 @@ static inline bool hash_search(rzip_control *control, struct rzip_state *st,
|
|||
cksum_chunks = control->checksum.len / control->maxram;
|
||||
cksum_remains = control->checksum.len % control->maxram;
|
||||
|
||||
control->checksum.buf = malloc(control->checksum.len);
|
||||
control->checksum.buf = malloc(control->maxram);
|
||||
if (unlikely(!control->checksum.buf))
|
||||
fatal_return(("Failed to malloc ckbuf in hash_search2\n"), false);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue