Kostya Serebryany | c135b55 | 2016-07-15 23:27:19 +0000 | [diff] [blame] | 1 | // 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 | |
| 11 | extern "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 | } |