mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-01-19 14:50:18 +01:00
Prevent infinite loop from crafted/corrupt archive in unzip_match.
This commit is contained in:
parent
b84c710902
commit
50cfb3b9f6
2
runzip.c
2
runzip.c
|
|
@ -219,6 +219,8 @@ static i64 unzip_match(rzip_control *control, void *ss, i64 len, uint32 *cksum,
|
|||
|
||||
while (len) {
|
||||
n = MIN(len, offset);
|
||||
if (unlikely(n < 1))
|
||||
fatal_return(("Failed fd history in unzip_match due to corrupt archive\n"), -1);
|
||||
|
||||
if (unlikely(read_fdhist(control, off_buf, (size_t)n) != (ssize_t)n)) {
|
||||
dealloc(buf);
|
||||
|
|
|
|||
Loading…
Reference in a new issue