Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: run fuzzers four times in a row #10794

Merged
merged 1 commit into from
Nov 16, 2018
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
8 changes: 7 additions & 1 deletion src/fuzz/fuzz-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
* It reads files named on the command line and passes them one by one into the
* fuzzer that it is compiled into. */

/* This one was borrowed from
* https://github.com/google/oss-fuzz/blob/646fca1b506b056db3a60d32c4a1a7398f171c94/infra/base-images/base-runner/bad_build_check#L19
*/
#define MIN_NUMBER_OF_RUNS 4

int main(int argc, char **argv) {
int i, r;
size_t size;
Expand All @@ -30,7 +35,8 @@ int main(int argc, char **argv) {
}
printf("%s... ", name);
fflush(stdout);
(void) LLVMFuzzerTestOneInput((uint8_t*)buf, size);
for (int j = 0; j < MIN_NUMBER_OF_RUNS; j++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I prefer here unsigned or size_t. But please ignore this now.

(void) LLVMFuzzerTestOneInput((uint8_t*)buf, size);
printf("ok\n");
}

Expand Down