Merge branch 'master' into master

This commit is contained in:
Chris Hennick 2024-05-07 22:13:53 -07:00 committed by GitHub
commit 010720fc54
Signed by: DevComp
GPG key ID: B5690EEEBB952194

View file

@ -1969,12 +1969,11 @@ mod test {
use crate::result::ZipResult; use crate::result::ZipResult;
use crate::types::DateTime; use crate::types::DateTime;
use crate::write::SimpleFileOptions; use crate::write::SimpleFileOptions;
use crate::CompressionMethod::{Deflated, Stored}; use crate::CompressionMethod::Stored;
use crate::ZipArchive; use crate::ZipArchive;
use std::io; use std::io;
use std::io::{Cursor, Read, Seek, SeekFrom, Write}; use std::io::{Cursor, Read, Write};
use std::path::PathBuf; use std::path::PathBuf;
use crate::AesMode::Aes128;
#[test] #[test]
fn write_empty_zip() { fn write_empty_zip() {
@ -2478,17 +2477,19 @@ mod test {
fn test_fuzz_failure_2024_05_08() -> ZipResult<()> { fn test_fuzz_failure_2024_05_08() -> ZipResult<()> {
let mut first_writer = ZipWriter::new(Cursor::new(Vec::new())); let mut first_writer = ZipWriter::new(Cursor::new(Vec::new()));
let mut second_writer = ZipWriter::new(Cursor::new(Vec::new())); let mut second_writer = ZipWriter::new(Cursor::new(Vec::new()));
let options = SimpleFileOptions::default().compression_method(Stored) let options = SimpleFileOptions::default()
.compression_method(Stored)
.with_alignment(46036); .with_alignment(46036);
second_writer.add_symlink("\0", "", options)?; second_writer.add_symlink("\0", "", options)?;
let mut second_archive = second_writer.finish_into_readable()?.into_inner(); let second_archive = second_writer.finish_into_readable()?.into_inner();
second_archive.seek(SeekFrom::Start(0))?;
let mut second_writer = ZipWriter::new_append(second_archive)?; let mut second_writer = ZipWriter::new_append(second_archive)?;
let options = SimpleFileOptions::default().compression_method(Deflated) let options = SimpleFileOptions::default()
.large_file(true).with_alignment(46036).with_aes_encryption(Aes128, "\0\0"); .compression_method(CompressionMethod::Deflated)
.large_file(true)
.with_alignment(46036)
.with_aes_encryption(crate::AesMode::Aes128, "\0\0");
second_writer.add_symlink("", "", options)?; second_writer.add_symlink("", "", options)?;
let mut second_archive = second_writer.finish_into_readable()?.into_inner(); let second_archive = second_writer.finish_into_readable()?.into_inner();
second_archive.seek(SeekFrom::Start(0))?;
let mut second_writer = ZipWriter::new_append(second_archive)?; let mut second_writer = ZipWriter::new_append(second_archive)?;
let options = SimpleFileOptions::default().compression_method(Stored); let options = SimpleFileOptions::default().compression_method(Stored);
second_writer.start_file(" ", options)?; second_writer.start_file(" ", options)?;