[compiler-rt] r336229 - [libFuzzer] add a tiny and surprisingly hard puzzle

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 3 14:17:56 PDT 2018


Author: kcc
Date: Tue Jul  3 14:17:55 2018
New Revision: 336229

URL: http://llvm.org/viewvc/llvm-project?rev=336229&view=rev
Log:
[libFuzzer] add a tiny and surprisingly hard puzzle

Added:
    compiler-rt/trunk/test/fuzzer/ThreeBytes.cpp

Added: compiler-rt/trunk/test/fuzzer/ThreeBytes.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/fuzzer/ThreeBytes.cpp?rev=336229&view=auto
==============================================================================
--- compiler-rt/trunk/test/fuzzer/ThreeBytes.cpp (added)
+++ compiler-rt/trunk/test/fuzzer/ThreeBytes.cpp Tue Jul  3 14:17:55 2018
@@ -0,0 +1,14 @@
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+
+// Find FUZ
+#include <cstddef>
+#include <cstdint>
+#include <cstdlib>
+
+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;
+}




More information about the llvm-commits mailing list