1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 // Test strstr and strcasestr hooks.
12 // Windows does not have strcasestr and memmem, so we are not testing them.
14 #define strcasestr strstr
15 #define memmem(a, b, c, d) true
18 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
19 if (Size
< 4) return 0;
20 std::string
s(reinterpret_cast<const char*>(Data
), Size
);
21 if (strstr(s
.c_str(), "FUZZ") &&
22 strcasestr(s
.c_str(), "aBcD") &&
23 memmem(s
.data(), s
.size(), "kuku", 4)
25 fprintf(stderr
, "BINGO\n");