diff --git a/fuzz/fuzz_targets/fuzz_read.rs b/fuzz/fuzz_targets/fuzz_read.rs index 7abb97ce..1559d260 100644 --- a/fuzz/fuzz_targets/fuzz_read.rs +++ b/fuzz/fuzz_targets/fuzz_read.rs @@ -10,7 +10,7 @@ fn decompress_all(data: &[u8]) -> Result<(), Box> { for i in 0..zip.len() { let file = zip.by_index(i)?; - let expected_bytes = file.size().max(MAX_BYTES_TO_READ); + let expected_bytes = file.size().min(MAX_BYTES_TO_READ); let result = std::io::copy(&mut file.take(MAX_BYTES_TO_READ), &mut std::io::sink()); if let Ok(bytes) = result { assert!(bytes <= expected_bytes)