mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-01-31 12:34:14 +01:00
Add sanity checking on chunk data on decompression.
This commit is contained in:
parent
33a6bf6234
commit
89d7b33e6a
4
stream.c
4
stream.c
|
|
@ -1116,6 +1116,10 @@ void *open_stream_in(rzip_control *control, int f, int n, char chunk_bytes)
|
|||
sinfo->size = le64toh(sinfo->size);
|
||||
print_maxverbose("Chunk size: %lld\n", sinfo->size);
|
||||
control->st_size += sinfo->size;
|
||||
if (unlikely(sinfo->chunk_bytes < 1 || sinfo->chunk_bytes > 8 || sinfo->size < 0)) {
|
||||
print_err("Invalid chunk data size %d bytes %lld\n", sinfo->size, sinfo->chunk_bytes);
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
}
|
||||
sinfo->initial_pos = get_readseek(control, f);
|
||||
|
|
|
|||
Loading…
Reference in a new issue