File tree Expand file tree Collapse file tree 6 files changed +18
-13
lines changed Expand file tree Collapse file tree 6 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ authors = [
10
10
description = " Fuzzing Rust code with american-fuzzy-lop"
11
11
repository = " https://github.com/rust-fuzz/afl.rs"
12
12
homepage = " https://github.com/rust-fuzz/afl.rs"
13
- edition = " 2021 "
13
+ edition = " 2024 "
14
14
exclude = [" etc" ]
15
15
16
16
[build-dependencies ]
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ use std::io::{self, Read};
10
10
use std:: panic;
11
11
12
12
// those functions are provided by the afl-llvm-rt static library
13
- extern "C" {
13
+ unsafe extern "C" {
14
14
fn __afl_persistent_loop ( counter : usize ) -> isize ;
15
15
fn __afl_manual_init ( ) ;
16
16
@@ -20,7 +20,7 @@ extern "C" {
20
20
21
21
#[ allow( non_upper_case_globals) ]
22
22
#[ doc( hidden) ]
23
- #[ no_mangle]
23
+ #[ unsafe ( no_mangle) ]
24
24
pub static mut __afl_sharedmem_fuzzing: i32 = 1 ;
25
25
26
26
/// Fuzz a closure by passing it a `&[u8]`
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ authors = [
11
11
description = " Fuzzing Rust code with american-fuzzy-lop"
12
12
repository = " https://github.com/rust-fuzz/afl.rs"
13
13
homepage = " https://github.com/rust-fuzz/afl.rs"
14
- edition = " 2021 "
14
+ edition = " 2024 "
15
15
exclude = [" etc" ]
16
16
17
17
[build-dependencies ]
Original file line number Diff line number Diff line change @@ -16,17 +16,18 @@ fn main() {
16
16
let building_on_docs_rs = env:: var ( "DOCS_RS" ) . is_ok ( ) ;
17
17
18
18
// smoelius: Build AFLplusplus only when installing and not building on docs.rs.
19
- if installing && !building_on_docs_rs {
20
- if let Err ( error) = config:: config ( & config:: Args {
19
+ if installing
20
+ && !building_on_docs_rs
21
+ && let Err ( error) = config:: config ( & config:: Args {
21
22
build : true ,
22
23
force : true ,
23
24
plugins : cfg ! ( feature = "plugins" ) ,
24
25
..Default :: default ( )
25
- } ) {
26
- println ! (
27
- "cargo:warn=Could not build AFLplusplus; it will need to be built manually with \
26
+ } )
27
+ {
28
+ println ! (
29
+ "cargo:warn=Could not build AFLplusplus; it will need to be built manually with \
28
30
`cargo afl config --build`: {error}"
29
- ) ;
30
- }
31
+ ) ;
31
32
}
32
33
}
Original file line number Diff line number Diff line change @@ -333,7 +333,9 @@ where
333
333
if no_cfg_fuzzing {
334
334
rustflags. push_str ( "--cfg no_fuzzing " ) ;
335
335
// afl-fuzz is sensitive to AFL_ env variables. Let's remove this particular one - it did it's job
336
- env:: remove_var ( "AFL_NO_CFG_FUZZING" ) ;
336
+ unsafe {
337
+ env:: remove_var ( "AFL_NO_CFG_FUZZING" ) ;
338
+ }
337
339
} else {
338
340
rustflags. push_str ( "--cfg fuzzing " ) ;
339
341
}
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ const BUILD_MSGS: &[&str] = &[
10
10
11
11
#[ ctor:: ctor]
12
12
fn init ( ) {
13
- env:: set_var ( "CARGO_TERM_COLOR" , "never" ) ;
13
+ unsafe {
14
+ env:: set_var ( "CARGO_TERM_COLOR" , "never" ) ;
15
+ }
14
16
}
15
17
16
18
#[ test]
You can’t perform that action at this time.
0 commit comments