Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Force -runs=1 when invoking in repro mode #1651

Merged
merged 5 commits into from
Feb 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/agent/onefuzz/src/libfuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ impl<'a> LibFuzzer<'a> {
// good input, which libfuzzer works as we expect.

let mut cmd = self.build_command(None, None, None).await?;

// Override any arg of the form `-runs=<N>` (last occurrence wins).
// In this command invocation, we only ever want to test inputs once.
//
// Assumes that the presence of an `-args` option was an iteration limit meant
// for fuzzing mode. We are only mutating the args of a local `Command`, so the
// command used by the `fuzz()` method will still receive the iteration limit.
cmd.arg("-runs=1");

cmd.arg(&input);

let result = cmd
Expand Down