diff --git a/libafl/src/generators/mod.rs b/libafl/src/generators/mod.rs index 424f4bd643..13fedb3cec 100644 --- a/libafl/src/generators/mod.rs +++ b/libafl/src/generators/mod.rs @@ -8,7 +8,7 @@ use libafl_bolts::rands::Rand; use crate::{inputs::bytes::BytesInput, nonzero, state::HasRand, Error}; pub mod gramatron; -use core::cmp::min; +use core::cmp::max; pub use gramatron::*; @@ -83,7 +83,7 @@ where { fn generate(&mut self, state: &mut S) -> Result { let mut size = state.rand_mut().below(self.max_size); - size = min(size, 1); + size = max(size, 1); let random_bytes: Vec = (0..size) .map(|_| state.rand_mut().below(nonzero!(256)) as u8) .collect(); @@ -111,7 +111,7 @@ where { fn generate(&mut self, state: &mut S) -> Result { let mut size = state.rand_mut().below(self.max_size); - size = min(size, 1); + size = max(size, 1); let printables = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz \t\n!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".as_bytes(); let random_bytes: Vec = (0..size) .map(|_| *state.rand_mut().choose(printables).unwrap()) diff --git a/libafl_frida/src/coverage_rt.rs b/libafl_frida/src/coverage_rt.rs index 60a058e060..04717add73 100644 --- a/libafl_frida/src/coverage_rt.rs +++ b/libafl_frida/src/coverage_rt.rs @@ -62,6 +62,7 @@ impl FridaRuntime for CoverageRuntime { impl CoverageRuntime { /// Create a new coverage runtime #[must_use] + #[allow(clippy::large_stack_arrays)] pub fn new() -> Self { Self(Rc::pin(RefCell::new(CoverageRuntimeInner { map: [0_u8; MAP_SIZE],