blob: e9d983ff1ebfe16cc9c3c834e6836bbd6921bf87 [file] [log] [blame]
Kostya Serebryany00ef2712016-09-09 18:00:04 +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.
Kostya Serebryany00ef2712016-09-09 18:00:04 +00005#include <cstddef>
Chandler Carruth6bda14b2017-06-06 11:49:48 +00006#include <cstdint>
Kostya Serebryany00ef2712016-09-09 18:00:04 +00007#include <cstdio>
Chandler Carruth6bda14b2017-06-06 11:49:48 +00008#include <cstdlib>
9#include <cstring>
Kostya Serebryany00ef2712016-09-09 18:00:04 +000010
11extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
12 if (Size < 8) return 0;
13 int x;
14 unsigned y;
Kostya Serebryany18371522016-09-09 22:21:16 +000015 memcpy(&x, Data, sizeof(x));
16 memcpy(&y, Data + sizeof(x), sizeof(y));
Kostya Serebryany00ef2712016-09-09 18:00:04 +000017 if (abs(x) < 0 && y == 0xbaddcafe) {
18 printf("BINGO; Found the target, exiting; x = 0x%x y 0x%x\n", x, y);
19 exit(1);
20 }
21 return 0;
22}
23