From 0bc9143de88b4fe8871615b0cda39f6f0db04ca8 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Tue, 3 Jul 2018 21:17:55 +0000 Subject: [PATCH] [libFuzzer] add a tiny and surprisingly hard puzzle llvm-svn: 336229 --- compiler-rt/test/fuzzer/ThreeBytes.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 compiler-rt/test/fuzzer/ThreeBytes.cpp diff --git a/compiler-rt/test/fuzzer/ThreeBytes.cpp b/compiler-rt/test/fuzzer/ThreeBytes.cpp new file mode 100644 index 0000000..754a5b0 --- /dev/null +++ b/compiler-rt/test/fuzzer/ThreeBytes.cpp @@ -0,0 +1,14 @@ +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. + +// Find FUZ +#include +#include +#include + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { + if (Size < 3) return 0; + uint32_t x = Data[0] + 251 * Data[1] + 251 * 251 * Data[2]; + if (x == 'F' + 251 * 'U' + 251 * 251 * 'Z') abort(); + return 0; +} -- 2.7.4