From 30ef662aa28661754115dbd2e755fb9166465d33 Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Sun, 5 May 2024 20:19:09 -0700 Subject: [PATCH] Revert "chore: Use panic! rather than abort to ensure the fuzz harness can process the failure" This reverts commit 0011370fdcd10de8e9424992fb3fd39452c40dab. --- fuzz/fuzz_targets/fuzz_write.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fuzz/fuzz_targets/fuzz_write.rs b/fuzz/fuzz_targets/fuzz_write.rs index 44493f2d..046eb81c 100644 --- a/fuzz/fuzz_targets/fuzz_write.rs +++ b/fuzz/fuzz_targets/fuzz_write.rs @@ -2,7 +2,7 @@ use arbitrary::Arbitrary; use libfuzzer_sys::fuzz_target; -use replace_with::replace_with; +use replace_with::replace_with_or_abort; use std::io::{Cursor, Read, Seek, Write}; use std::path::PathBuf; @@ -83,9 +83,7 @@ where } if operation.reopen { let old_comment = writer.get_raw_comment().to_owned(); - replace_with(writer, || { - panic!("Failed to reopen writer"); - }, |old_writer: zip::ZipWriter| { + replace_with_or_abort(writer, |old_writer: zip::ZipWriter| { let new_writer = zip::ZipWriter::new_append(old_writer.finish().unwrap()).unwrap(); assert_eq!(&old_comment, new_writer.get_raw_comment());