Skip to content

Commit

Permalink
no min but max
Browse files Browse the repository at this point in the history
  • Loading branch information
tokatoka authored Oct 21, 2024
1 parent fda1596 commit 547128e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libafl/src/generators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ where
{
fn generate(&mut self, state: &mut S) -> Result<BytesInput, Error> {
let mut size = state.rand_mut().below(self.max_size);
size = min(size, 1);
size = max(size, 1);
let random_bytes: Vec<u8> = (0..size)
.map(|_| state.rand_mut().below(nonzero!(256)) as u8)
.collect();
Expand Down Expand Up @@ -111,7 +111,7 @@ where
{
fn generate(&mut self, state: &mut S) -> Result<BytesInput, Error> {
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<u8> = (0..size)
.map(|_| *state.rand_mut().choose(printables).unwrap())
Expand Down

0 comments on commit 547128e

Please sign in to comment.