2016-09-10 02:00:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
|
|
|
|
// abs(x) < 0 and y == Const puzzle.
|
|
|
|
#include <cstddef>
|
2017-06-06 19:49:48 +08:00
|
|
|
#include <cstdint>
|
2016-09-10 02:00:04 +08:00
|
|
|
#include <cstdio>
|
2017-06-06 19:49:48 +08:00
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstring>
|
2016-09-10 02:00:04 +08:00
|
|
|
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|
|
|
if (Size < 8) return 0;
|
|
|
|
int x;
|
|
|
|
unsigned y;
|
2016-09-10 06:21:16 +08:00
|
|
|
memcpy(&x, Data, sizeof(x));
|
|
|
|
memcpy(&y, Data + sizeof(x), sizeof(y));
|
2016-09-10 02:00:04 +08:00
|
|
|
if (abs(x) < 0 && y == 0xbaddcafe) {
|
|
|
|
printf("BINGO; Found the target, exiting; x = 0x%x y 0x%x\n", x, y);
|
2017-07-21 04:43:39 +08:00
|
|
|
fflush(stdout);
|
2016-09-10 02:00:04 +08:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|