Index: compiler-rt/test/fuzzer/InitializeTest.cpp =================================================================== --- compiler-rt/test/fuzzer/InitializeTest.cpp +++ compiler-rt/test/fuzzer/InitializeTest.cpp @@ -9,6 +9,7 @@ #include #include +// Set an arbitrary max length to make things easier for libFuzzer. static char *argv0; extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { @@ -20,10 +21,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { assert(argv0); - if (Size == strlen(argv0) && - !memmem(Data, Size, argv0, Size)) { + char* DataStr = new char[Size + 1](); + memcpy(DataStr, Data, Size); + DataStr[Size] = '\0'; + if (Size == strlen(argv0) && !strstr(DataStr, argv0)) { fprintf(stderr, "BINGO %s\n", argv0); + delete[] DataStr; exit(1); } + delete[] DataStr; return 0; } Index: compiler-rt/test/fuzzer/initialize.test =================================================================== --- compiler-rt/test/fuzzer/initialize.test +++ compiler-rt/test/fuzzer/initialize.test @@ -1,4 +1,4 @@ -# FIXME: Disabled on Windows because memmem is a GNU extension. +# FIXME: Disabled on Windows since LLVMFuzzerInitialize does not yet work. UNSUPPORTED: windows CHECK: BINGO RUN: %cpp_compiler %S/InitializeTest.cpp -o %t-InitializeTest