Index: lib/fuzzer/afl/afl_driver.cpp =================================================================== --- lib/fuzzer/afl/afl_driver.cpp +++ lib/fuzzer/afl/afl_driver.cpp @@ -88,7 +88,7 @@ // to the file as well, if the error occurs after the duplication is performed. #define CHECK_ERROR(cond, error_message) \ if (!(cond)) { \ - fprintf(stderr, (error_message)); \ + fprintf(stderr, "%s\n", (error_message)); \ abort(); \ } @@ -298,6 +298,12 @@ __afl_manual_init(); + // Call LLVMFuzzerTestOneInput here so that initialization is done before + // AFL considers it code covered by a particular input. Don't do this before + // __afl_manual_init() or some targets may break. + uint8_t dummy_input[1] = {0}; + LLVMFuzzerTestOneInput(dummy_input, 1); + int N = 1000; if (argc == 2 && argv[1][0] == '-') N = atoi(argv[1] + 1);