diff --git a/afl/examples/llmp_test/main.rs b/afl/examples/llmp_test/main.rs index 18f08e42bb..5f5bccf3b3 100644 --- a/afl/examples/llmp_test/main.rs +++ b/afl/examples/llmp_test/main.rs @@ -1,13 +1,15 @@ +/*! +This shows how llmp can be used directly, without libafl abstractions +*/ extern crate alloc; -use core::convert::TryInto; -use core::time::Duration; -use std::thread; -use std::time; +use core::{convert::TryInto, time::Duration}; +use std::{thread, time}; -use afl::events::llmp; -use afl::events::shmem::AflShmem; -use afl::AflError; +use afl::{ + events::{llmp, shmem::AflShmem}, + AflError, +}; const TAG_SIMPLE_U32_V1: u32 = 0x51300321; const TAG_MATH_RESULT_V1: u32 = 0x77474331; diff --git a/fuzzers/libfuzzer_runtime/rt.c b/fuzzers/libfuzzer_runtime/rt.c index 164c3351cc..f7baa9c382 100644 --- a/fuzzers/libfuzzer_runtime/rt.c +++ b/fuzzers/libfuzzer_runtime/rt.c @@ -22,7 +22,7 @@ void __sanitizer_cov_trace_pc_guard(uint32_t *guard) { void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) { - if (start == stop || *start) return; + if (start == stop || *start) { return; } *(start++) = (++__lafl_max_edges_size) & (MAP_SIZE -1); @@ -124,8 +124,7 @@ void __sanitizer_cov_trace_switch(uint64_t val, uint64_t *cases) { } - - static void afl_libfuzzer_copy_args(int argc, char** argv, char** envp) { +static void afl_libfuzzer_copy_args(int argc, char** argv, char** envp) { orig_argc = argc; orig_argv = argv; orig_envp = envp; @@ -138,9 +137,10 @@ void afl_libfuzzer_main(); int afl_libfuzzer_init() { - if (LLVMFuzzerInitialize) + if (LLVMFuzzerInitialize) { return LLVMFuzzerInitialize(&orig_argc, &orig_argv); - else + } else { return 0; + } }