blob: 90d539b660a9b9e2f376170091d04d2951beeacc [file] [log] [blame]
Kostya Serebryanyc135b552016-07-15 23:27:19 +00001// This file is distributed under the University of Illinois Open Source
2// License. See LICENSE.TXT for details.
3
4// Test strstr and strcasestr hooks.
5#include <string>
6#include <string.h>
7#include <cstdint>
8#include <cstdio>
9#include <cstdlib>
10
11extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
12 std::string s(reinterpret_cast<const char*>(Data), Size);
13 if (strstr(s.c_str(), "FUZZ") && strcasestr(s.c_str(), "aBcD")) {
14 fprintf(stderr, "BINGO\n");
15 exit(1);
16 }
17 return 0;
18}