mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 03:18:07 +00:00
rust custom mutator: mark external fns unsafe
This commit is contained in:
@ -247,7 +247,7 @@ pub mod wrappers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Internal function used in the macro
|
/// 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,
|
data: *mut c_void,
|
||||||
filename_new_queue: *const c_char,
|
filename_new_queue: *const c_char,
|
||||||
filename_orig_queue: *const c_char,
|
filename_orig_queue: *const c_char,
|
||||||
@ -337,7 +337,7 @@ pub mod wrappers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Internal function used in the macro
|
/// 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,
|
data: *mut c_void,
|
||||||
filename: *const c_char,
|
filename: *const c_char,
|
||||||
) -> u8 {
|
) -> u8 {
|
||||||
@ -441,7 +441,7 @@ macro_rules! export_mutator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[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,
|
data: *mut ::std::os::raw::c_void,
|
||||||
filename_new_queue: *const ::std::os::raw::c_char,
|
filename_new_queue: *const ::std::os::raw::c_char,
|
||||||
filename_orig_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]
|
#[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,
|
data: *mut ::std::os::raw::c_void,
|
||||||
filename: *const ::std::os::raw::c_char,
|
filename: *const ::std::os::raw::c_char,
|
||||||
) -> u8 {
|
) -> u8 {
|
||||||
@ -757,8 +757,7 @@ mod truncate_test {
|
|||||||
let actual_output = truncate_str_unicode_safe(input, *max_len);
|
let actual_output = truncate_str_unicode_safe(input, *max_len);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
&actual_output, expected_output,
|
&actual_output, expected_output,
|
||||||
"{:#?} truncated to {} bytes should be {:#?}, but is {:#?}",
|
"{input:#?} truncated to {max_len} bytes should be {expected_output:#?}, but is {actual_output:#?}"
|
||||||
input, max_len, expected_output, actual_output
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "example_lain"
|
name = "example_lain"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Julius Hohnerlein <julihoh@users.noreply.github.com>"]
|
authors = ["Julius Hohnerlein <julihoh@users.noreply.github.com>"]
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user