Skip to content

Commit

Permalink
Update afl/src/lib.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Moelius <[email protected]>
  • Loading branch information
vanhauser-thc and smoelius authored Dec 15, 2023
1 parent b5a679b commit a86ef47
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions afl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ where

let mut input = vec![];

let loop_count: usize = env::var("AFL_FUZZER_LOOPCOUNT")
.unwrap_or_else(|_| u32::MAX.to_string())
.parse::<usize>()
.expect("Failed to parse environment variable to a number");
let loop_count = if let Ok(value) = env::var("AFL_FUZZER_LOOPCOUNT") {
value
.parse()
.expect("Failed to parse environment variable to a number")
} else {
usize::MAX
};

// initialize forkserver there
unsafe { __afl_manual_init() };
Expand Down

0 comments on commit a86ef47

Please sign in to comment.