Skip to content

Commit f267b63

Browse files
committed
Mark internal, hidden LLVMFuzzerTestOneInput LibFuzzer hook as unsafe
Fixes #112
1 parent b3f9e4f commit f267b63

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ extern "C" {
5353
fn LLVMFuzzerMutate(data: *mut u8, size: usize, max_size: usize) -> usize;
5454
}
5555

56+
/// Do not use; only for LibFuzzer's consumption.
5657
#[doc(hidden)]
5758
#[export_name = "LLVMFuzzerTestOneInput"]
58-
pub fn test_input_wrap(data: *const u8, size: usize) -> i32 {
59-
let test_input = ::std::panic::catch_unwind(|| unsafe {
59+
pub unsafe fn test_input_wrap(data: *const u8, size: usize) -> i32 {
60+
let test_input = ::std::panic::catch_unwind(|| {
6061
let data_slice = ::std::slice::from_raw_parts(data, size);
6162
rust_fuzzer_test_input(data_slice)
6263
});

0 commit comments

Comments
 (0)