aboutsummaryrefslogtreecommitdiff
path: root/custom_mutators/rust/custom_mutator
diff options
context:
space:
mode:
authorDominik Maier <dmnk@google.com>2023-01-05 12:25:02 +0000
committerDominik Maier <dmnk@google.com>2023-01-05 12:25:02 +0000
commita3b56e7280cb5b5cea21c66c40d4390db6f13b8f (patch)
treecc2599499e847c4ac661988d1c5fe7b35a5ef82e /custom_mutators/rust/custom_mutator
parent57e7408774a5276baaecd9dd5a6c73f1cbbf866b (diff)
downloadafl++-a3b56e7280cb5b5cea21c66c40d4390db6f13b8f.tar.gz
rust custom mutator: mark external fns unsafe
Diffstat (limited to 'custom_mutators/rust/custom_mutator')
-rw-r--r--custom_mutators/rust/custom_mutator/src/lib.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/custom_mutators/rust/custom_mutator/src/lib.rs b/custom_mutators/rust/custom_mutator/src/lib.rs
index 09ac11f3..3b635eb5 100644
--- a/custom_mutators/rust/custom_mutator/src/lib.rs
+++ b/custom_mutators/rust/custom_mutator/src/lib.rs
@@ -247,7 +247,7 @@ pub mod wrappers {
}
/// Internal function used in the macro
- pub fn afl_custom_queue_new_entry_<M: RawCustomMutator>(
+ pub unsafe fn afl_custom_queue_new_entry_<M: RawCustomMutator>(
data: *mut c_void,
filename_new_queue: *const c_char,
filename_orig_queue: *const c_char,
@@ -337,7 +337,7 @@ pub mod wrappers {
}
/// Internal function used in the macro
- pub fn afl_custom_queue_get_<M: RawCustomMutator>(
+ pub unsafe fn afl_custom_queue_get_<M: RawCustomMutator>(
data: *mut c_void,
filename: *const c_char,
) -> u8 {
@@ -441,7 +441,7 @@ macro_rules! export_mutator {
}
#[no_mangle]
- pub extern "C" fn afl_custom_queue_new_entry(
+ pub unsafe extern "C" fn afl_custom_queue_new_entry(
data: *mut ::std::os::raw::c_void,
filename_new_queue: *const ::std::os::raw::c_char,
filename_orig_queue: *const ::std::os::raw::c_char,
@@ -454,7 +454,7 @@ macro_rules! export_mutator {
}
#[no_mangle]
- pub extern "C" fn afl_custom_queue_get(
+ pub unsafe extern "C" fn afl_custom_queue_get(
data: *mut ::std::os::raw::c_void,
filename: *const ::std::os::raw::c_char,
) -> u8 {
@@ -757,8 +757,7 @@ mod truncate_test {
let actual_output = truncate_str_unicode_safe(input, *max_len);
assert_eq!(
&actual_output, expected_output,
- "{:#?} truncated to {} bytes should be {:#?}, but is {:#?}",
- input, max_len, expected_output, actual_output
+ "{input:#?} truncated to {max_len} bytes should be {expected_output:#?}, but is {actual_output:#?}"
);
}
}