1348
|
1 #include "fuzz.h" |
|
2 #include "dbrandom.h" |
|
3 #include "session.h" |
|
4 |
|
5 static int setup_fuzzer(void) { |
|
6 svr_setup_fuzzer(); |
|
7 return 0; |
|
8 } |
|
9 |
|
10 int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { |
|
11 static int once = 0; |
|
12 if (!once) { |
|
13 setup_fuzzer(); |
|
14 once = 1; |
|
15 } |
|
16 |
|
17 fuzz.input.data = (unsigned char*)Data; |
|
18 fuzz.input.size = Size; |
|
19 fuzz.input.len = Size; |
|
20 fuzz.input.pos = 0; |
|
21 |
|
22 seedrandom(); |
|
23 |
|
24 if (setjmp(fuzz.jmp) == 0) { |
|
25 svr_session(-1, -1); |
|
26 } else { |
|
27 // dropbear_exit jumped here |
|
28 } |
|
29 |
|
30 return 0; |
|
31 } |