blob: 2776deab97ad565c82732e07dd4002afa5d00aeb [file] [log] [blame]
Juraj Vijtiuk260407e2020-03-18 10:32:13 +01001#include <stdio.h>
2#include <stdint.h>
3#include <stdlib.h>
4
5#ifdef __AFL_COMPILER
6
7int main(void) {
8 int ret;
9 uint8_t buf[64 * 1024];
10
11#ifdef __AFL_LOOP
12 while (__AFL_LOOP(10000))
13#endif
14 {
15 ret = fread(buf, 1, sizeof(buf), stdin);
16 if (ret < 0) {
17 return 0;
18 }
19
20 LLVMFuzzerTestOneInput(buf, ret);
21
22 }
23
24 return 0;
25}
26
Juraj Vijtiukc496e6f2020-06-30 16:15:01 +020027#else
28int main(void) {
29 int ret;
30 uint8_t buf[64 * 1024];
31
32 ret = fread(buf, 1, sizeof(buf), stdin);
33 if (ret < 0) {
34 return 0;
35 }
36
37 LLVMFuzzerTestOneInput(buf, ret);
38
39 return 0;
40}
Juraj Vijtiuk260407e2020-03-18 10:32:13 +010041#endif /* __AFL_COMPILER */