From 5220222f8437196f4b7e8d4e58eb986f9a0fbefd Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 1 May 2023 15:35:36 -0700 Subject: [PATCH] Bug fix --- fuzz/fuzz_targets/fuzz_write.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fuzz/fuzz_targets/fuzz_write.rs b/fuzz/fuzz_targets/fuzz_write.rs index 104c139a..a13d9b06 100644 --- a/fuzz/fuzz_targets/fuzz_write.rs +++ b/fuzz/fuzz_targets/fuzz_write.rs @@ -104,12 +104,13 @@ fn do_operation(writer: &mut zip_next::ZipWriter, FileOperation::WriteLarge {file, mut options} => { options = options.large_file(true); writer.start_file(file.name.to_owned(), options)?; - let written: usize = 0; + let mut written: usize = 0; while written < LARGE_FILE_BUF_SIZE { for chunk in &file.large_contents { let chunk: Vec = chunk.to_owned().into_iter() .flat_map(RepeatedBytes::into_iter) .collect(); + written += chunk.len(); writer.write_all(chunk.as_slice())?; } }