diff --git a/fuzz/fuzz_targets/fuzz_write.rs b/fuzz/fuzz_targets/fuzz_write.rs index 8e57d811..88d299b2 100644 --- a/fuzz/fuzz_targets/fuzz_write.rs +++ b/fuzz/fuzz_targets/fuzz_write.rs @@ -88,7 +88,7 @@ fn do_operation(writer: &mut zip_next::ZipWriter, let mut bytes = Vec::with_capacity(part.extra_bytes.len() + 1); bytes.push(part.first_byte); bytes.extend(part.extra_bytes); - for (index, byte) in repeat(bytes.iter()).take(part.repeats).flatten().enumerate() { + for (index, byte) in repeat(bytes.iter()).take(part.repeats as usize + 1).flatten().enumerate() { sparse_file[part.start as usize + index] = *byte; } }