diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 01a27f65197..2aa939ae6d2 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -149,8 +149,16 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - #- name: Build frida - # run: cd fuzzers/frida_libpng/ && cargo build --release + - name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797 + uses: KyleMayes/install-llvm-action@32c4866ebb71e0949e8833eb49beeebed48532bd + with: + version: "12.0" + directory: ${{ runner.temp }}/llvm + - name: Set LIBCLANG_PATH + run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV + - name: Build frida + run: cd fuzzers/frida_libpng/ && cargo build --release + macos: runs-on: macOS-latest steps: diff --git a/libafl_frida/src/alloc.rs b/libafl_frida/src/alloc.rs index a440c724ae0..549436355bf 100644 --- a/libafl_frida/src/alloc.rs +++ b/libafl_frida/src/alloc.rs @@ -121,10 +121,8 @@ impl Allocator { let base: usize = 2; // On x64, if end > 2**48, then that's in vsyscall or something. #[cfg(target_arch = "x86_64")] - if end <= base.pow(48) { - if end > userspace_max { - userspace_max = end; - } + if end <= base.pow(48) && end > userspace_max { + userspace_max = end; } // On x64, if end > 2**52, then range is not in userspace diff --git a/libafl_frida/src/helper.rs b/libafl_frida/src/helper.rs index 275b6124a30..2e2438ba397 100644 --- a/libafl_frida/src/helper.rs +++ b/libafl_frida/src/helper.rs @@ -407,11 +407,8 @@ where /// Pointer to coverage map pub fn map_ptr_mut(&mut self) -> Option<*mut u8> { - if let Some(rt) = self.runtime_mut::() { - Some(rt.map_ptr_mut()) - } else { - None - } + self.runtime_mut::() + .map(CoverageRuntime::map_ptr_mut) } /// Ranges diff --git a/libafl_sugar/src/forkserver.rs b/libafl_sugar/src/forkserver.rs index 7f5bcf5d4c3..ff17b15f328 100644 --- a/libafl_sugar/src/forkserver.rs +++ b/libafl_sugar/src/forkserver.rs @@ -321,6 +321,7 @@ pub mod pybind { impl ForkserverBytesCoverageSugar { /// Create a new [`ForkserverBytesCoverageSugar`] #[new] + #[allow(clippy::too_many_arguments)] fn new( input_dirs: Vec, output_dir: PathBuf, diff --git a/libafl_sugar/src/inmemory.rs b/libafl_sugar/src/inmemory.rs index 076a4f82eac..292702625aa 100644 --- a/libafl_sugar/src/inmemory.rs +++ b/libafl_sugar/src/inmemory.rs @@ -385,6 +385,7 @@ pub mod pybind { impl InMemoryBytesCoverageSugar { /// Create a new [`InMemoryBytesCoverageSugar`] #[new] + #[allow(clippy::too_many_arguments)] fn new( input_dirs: Vec, output_dir: PathBuf, diff --git a/libafl_sugar/src/qemu.rs b/libafl_sugar/src/qemu.rs index d5776636428..5b5cd00ce3d 100644 --- a/libafl_sugar/src/qemu.rs +++ b/libafl_sugar/src/qemu.rs @@ -449,6 +449,7 @@ pub mod pybind { impl QemuBytesCoverageSugar { /// Create a new [`QemuBytesCoverageSugar`] #[new] + #[allow(clippy::too_many_arguments)] fn new( input_dirs: Vec, output_dir: PathBuf,