summaryrefslogtreecommitdiffstats
path: root/third_party/rust/zip/src/read.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /third_party/rust/zip/src/read.rs
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/zip/src/read.rs')
-rw-r--r--third_party/rust/zip/src/read.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/third_party/rust/zip/src/read.rs b/third_party/rust/zip/src/read.rs
index dad20c260b..3f3f41010c 100644
--- a/third_party/rust/zip/src/read.rs
+++ b/third_party/rust/zip/src/read.rs
@@ -334,13 +334,10 @@ impl<R: Read + io::Seek> ZipArchive<R> {
// offsets all being too small. Get the amount of error by comparing
// the actual file position we found the CDE at with the offset
// recorded in the CDE.
- let archive_offset = cde_start_pos
- .checked_sub(footer.central_directory_size as u64)
- .and_then(|x| x.checked_sub(footer.central_directory_offset as u64))
- .ok_or(ZipError::InvalidArchive(
- "Invalid central directory size or offset",
- ))?;
+ // Bug 1895599: omnijars nor other zips we read have data prepended to them; trust
+ // the offsets!
+ let archive_offset = 0;
let directory_start = footer.central_directory_offset as u64 + archive_offset;
let number_of_files = footer.number_of_files_on_this_disk as usize;
Ok((archive_offset, directory_start, number_of_files))