diff --git a/src/lib.rs b/src/lib.rs index a166516..ddf0d35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,10 +53,11 @@ extern "C" { fn LLVMFuzzerMutate(data: *mut u8, size: usize, max_size: usize) -> usize; } +/// Do not use; only for LibFuzzer's consumption. #[doc(hidden)] #[export_name = "LLVMFuzzerTestOneInput"] -pub fn test_input_wrap(data: *const u8, size: usize) -> i32 { - let test_input = ::std::panic::catch_unwind(|| unsafe { +pub unsafe fn test_input_wrap(data: *const u8, size: usize) -> i32 { + let test_input = ::std::panic::catch_unwind(|| { let data_slice = ::std::slice::from_raw_parts(data, size); rust_fuzzer_test_input(data_slice) });