aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Fuzzer/test/MemcmpTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer/test/MemcmpTest.cpp')
-rw-r--r--llvm/lib/Fuzzer/test/MemcmpTest.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Fuzzer/test/MemcmpTest.cpp b/llvm/lib/Fuzzer/test/MemcmpTest.cpp
index 510a243..cabdff8f 100644
--- a/llvm/lib/Fuzzer/test/MemcmpTest.cpp
+++ b/llvm/lib/Fuzzer/test/MemcmpTest.cpp
@@ -5,8 +5,13 @@
#include <cstdlib>
extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
+ // TODO: check other sizes.
if (Size >= 8 && memcmp(Data, "01234567", 8) == 0) {
- fprintf(stderr, "BINGO\n");
- exit(1);
+ if (Size >= 12 && memcmp(Data + 8, "ABCD", 4) == 0) {
+ if (Size >= 14 && memcmp(Data + 12, "XY", 2) == 0) {
+ fprintf(stderr, "BINGO\n");
+ exit(1);
+ }
+ }
}
}