From 5e91df081308876e0ab0e4f1bc997c4cbca08961 Mon Sep 17 00:00:00 2001 From: Danny McClanahan <1305167+cosmicexplorer@users.noreply.github.com> Date: Sat, 4 May 2024 05:12:47 -0400 Subject: [PATCH] fix another fuzz error --- src/spec.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/spec.rs diff --git a/src/spec.rs b/src/spec.rs old mode 100644 new mode 100755 index 76faf17fa..ce6e4483b --- a/src/spec.rs +++ b/src/spec.rs @@ -516,10 +516,13 @@ impl Zip64CentralDirectoryEnd { * smaller than END_WINDOW_SIZE). */ let end = (window_start + END_WINDOW_SIZE as u64).min(search_upper_bound); + debug_assert!(end >= window_start); let cur_len = (end - window_start) as usize; + if cur_len == 0 { + break; + } debug_assert!(cur_len <= END_WINDOW_SIZE); let cur_window: &mut [u8] = &mut window[..cur_len]; - assert!(!cur_window.is_empty()); /* Read the window into the bytes! */ reader.read_exact(cur_window)?;