diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:05:08 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:05:08 +0000 |
commit | 0646903fc1f75f6e605754621119473ee083f4a4 (patch) | |
tree | 57bce79a7423a054cccec23bdf6cd96e2d271b4a /test/fuzzer/InitializeTest.cpp | |
parent | 005b7ed8f76756d94ef6266ded755ab7863cb936 (diff) |
Diffstat (limited to 'test/fuzzer/InitializeTest.cpp')
-rw-r--r-- | test/fuzzer/InitializeTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/fuzzer/InitializeTest.cpp b/test/fuzzer/InitializeTest.cpp index a93c2a525088..5022c9efa640 100644 --- a/test/fuzzer/InitializeTest.cpp +++ b/test/fuzzer/InitializeTest.cpp @@ -9,7 +9,7 @@ #include <stdlib.h> #include <string.h> -static char *argv0; +static char *argv0 = NULL; extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { assert(*argc > 0); @@ -20,8 +20,7 @@ extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { assert(argv0); - if (Size == strlen(argv0) && - !memmem(Data, Size, argv0, Size)) { + if (argv0 && Size >= 4 && !memcmp(Data, "fuzz", 4)) { fprintf(stderr, "BINGO %s\n", argv0); exit(1); } |