fix: add header offset overflow check
- during the header offset calculation, perform overflow check Tested: - Local tests
This commit is contained in:
parent
06b41010ea
commit
8a666b102b
1 changed files with 4 additions and 1 deletions
|
@ -603,7 +603,10 @@ pub(crate) fn central_header_to_zip_file<R: Read + io::Seek>(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account for shifted zip offsets.
|
// Account for shifted zip offsets.
|
||||||
result.header_start += archive_offset;
|
result.header_start = result
|
||||||
|
.header_start
|
||||||
|
.checked_add(archive_offset)
|
||||||
|
.ok_or(ZipError::InvalidArchive("Archive header is too large"))?;
|
||||||
|
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue