fuzz: enable AFLFUZZ_PERSISTANT_MODE for libfuzzer targets

pull/4715/head
Philippe Antoine 6 years ago committed by Victor Julien
parent ac35118ebe
commit 9eddaa038e

@ -1,6 +1,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include "config.h"
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
@ -13,6 +14,10 @@ int main(int argc, char** argv)
if (argc != 2) {
return 1;
}
#ifdef AFLFUZZ_PERSISTANT_MODE
while (__AFL_LOOP(1000)) {
#endif /* AFLFUZZ_PERSISTANT_MODE */
//opens the file, get its size, and reads it into a buffer
fp = fopen(argv[1], "rb");
if (fp == NULL) {
@ -46,5 +51,10 @@ int main(int argc, char** argv)
LLVMFuzzerTestOneInput(data, size);
free(data);
fclose(fp);
#ifdef AFLFUZZ_PERSISTANT_MODE
}
#endif /* AFLFUZZ_PERSISTANT_MODE */
return 0;
}

Loading…
Cancel
Save