From 1006ddb0e95ca38e08abddd8ad68865c46628411 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 1 May 2023 16:10:59 -0700 Subject: [PATCH] Bug fix: need to make a copy --- fuzz/fuzz_targets/fuzz_write.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fuzz/fuzz_targets/fuzz_write.rs b/fuzz/fuzz_targets/fuzz_write.rs index 88d299b2..51d52b8a 100644 --- a/fuzz/fuzz_targets/fuzz_write.rs +++ b/fuzz/fuzz_targets/fuzz_write.rs @@ -28,7 +28,7 @@ pub struct LargeFile { pub default_pattern_first_byte: u8, pub default_pattern_extra_bytes: Vec, pub parts: Vec, - pub min_extra_length: u32 + pub min_extra_length: u16 } #[derive(Arbitrary,Debug)] @@ -87,7 +87,7 @@ fn do_operation(writer: &mut zip_next::ZipWriter, for part in &file.parts { let mut bytes = Vec::with_capacity(part.extra_bytes.len() + 1); bytes.push(part.first_byte); - bytes.extend(part.extra_bytes); + bytes.extend(part.extra_bytes.iter()); for (index, byte) in repeat(bytes.iter()).take(part.repeats as usize + 1).flatten().enumerate() { sparse_file[part.start as usize + index] = *byte; }