This commit is contained in:
Chris Hennick 2023-05-11 20:14:26 -07:00
parent fba2b971ae
commit 332d09f51a
No known key found for this signature in database
GPG key ID: 25653935CC8B6C74

View file

@ -1244,16 +1244,14 @@ mod test {
#[test] #[test]
fn zip64_magic_in_filenames() { fn zip64_magic_in_filenames() {
let files = vec![ let files = vec![
include_bytes!("../tests/data/zip64_magic_in_filename_1.zip"), include_bytes!("../tests/data/zip64_magic_in_filename_1.zip").to_vec(),
include_bytes!("../tests/data/zip64_magic_in_filename_2.zip"), include_bytes!("../tests/data/zip64_magic_in_filename_2.zip").to_vec(),
include_bytes!("../tests/data/zip64_magic_in_filename_3.zip"), include_bytes!("../tests/data/zip64_magic_in_filename_3.zip").to_vec()
]; ];
// Although we don't allow adding files whose names contain the ZIP64 CDB-end or // Although we don't allow adding files whose names contain the ZIP64 CDB-end or
// CDB-end-locator signatures, we still read them when they aren't genuinely ambiguous. // CDB-end-locator signatures, we still read them when they aren't genuinely ambiguous.
for file in files { for file in files {
let mut v = Vec::new(); ZipArchive::new(Cursor::new(file)).unwrap();
v.extend_from_slice(file);
ZipArchive::new(Cursor::new(v)).unwrap();
} }
} }