Skip to content

Commit

Permalink
fix another fuzz error
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed May 4, 2024
1 parent 2ce133f commit 5e91df0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/spec.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;

Expand Down

0 comments on commit 5e91df0

Please sign in to comment.