Skip to content

Commit

Permalink
implement dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
ifratric committed Dec 1, 2021
1 parent 6e49460 commit 0d1c22f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ void Fuzzer::ParseOptions(int argc, char **argv) {
track_ranges = GetBinaryOption("-track_ranges", argc, argv, false);

Sample::max_size = (size_t)GetIntOption("-max_sample_size", argc, argv, DEFAULT_MAX_SAMPLE_SIZE);

dry_run = GetBinaryOption("-dry_run", argc, argv, false);
}

void Fuzzer::SetupDirectories() {
Expand Down Expand Up @@ -596,6 +598,10 @@ void Fuzzer::SynchronizeAndGetJob(ThreadContext* tc, FuzzerJob* job) {
}

// create a job according to the state
if ((state == FUZZING) && dry_run) {
printf("Dry run done");
exit(0);
}

if (state == FUZZING) {
if (sample_queue.empty()) {
Expand Down
2 changes: 2 additions & 0 deletions fuzzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ class Fuzzer {
bool clean_target_on_coverage;

bool should_restore_state;

bool dry_run;

Mutex crash_mutex;
std::unordered_map<std::string, int> unique_crashes;
Expand Down

0 comments on commit 0d1c22f

Please sign in to comment.