diff options
| author | 2017-01-24 08:32:59 +0000 | |
|---|---|---|
| committer | 2017-01-24 08:32:59 +0000 | |
| commit | 53d771aafdbe5b919f264f53cba3788e2c4cffd2 (patch) | |
| tree | 7eca39498be0ff1e3a6daf583cd9ca5886bb2636 /gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp | |
| parent | In preparation of compiling our kernels with -ffreestanding, explicitly map (diff) | |
| download | wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.tar.xz wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.zip | |
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
Diffstat (limited to 'gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp')
| -rw-r--r-- | gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp b/gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp index d40ff2f7936..0d6a0fda093 100644 --- a/gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp +++ b/gnu/llvm/lib/Fuzzer/test/InitializeTest.cpp @@ -12,14 +12,16 @@ static char *argv0; extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { - assert(argc > 0); + assert(*argc > 0); argv0 = **argv; + fprintf(stderr, "LLVMFuzzerInitialize: %s\n", argv0); return 0; } extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (strncmp(reinterpret_cast<const char*>(Data), argv0, Size)) { - fprintf(stderr, "BINGO\n"); + if (Size == strlen(argv0) && + !strncmp(reinterpret_cast<const char *>(Data), argv0, Size)) { + fprintf(stderr, "BINGO %s\n", argv0); exit(1); } return 0; |
