blob: 0d199fcb4189571b7fbd631a3b952f0bd31ca264 [file] [log] [blame]
Kostya Serebryany4b17a332016-09-09 21:58:42 +00001// This file is distributed under the University of Illinois Open Source
2// License. See LICENSE.TXT for details.
3
4// abs(x) < 0 and y == Const puzzle, 64-bit variant.
5#include <cstring>
6#include <cstdint>
7#include <cstdlib>
8#include <cstddef>
9#include <cstdio>
10
11extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
12 if (Size < 16) return 0;
13 long x;
14 unsigned long y;
15 memcpy(&x, Data, 8);
16 memcpy(&y, Data + 8, 8);
17 if (labs(x) < 0 && y == 0xbaddcafedeadbeefUL) {
18 printf("BINGO; Found the target, exiting; x = 0x%lx y 0x%lx\n", x, y);
19 exit(1);
20 }
21 return 0;
22}
23