/src/unbound/parse_packet_fuzzer.c
Line | Count | Source (jump to first uncovered line) |
1 | | #include "config.h" |
2 | | #include "util/regional.h" |
3 | | #include "util/fptr_wlist.h" |
4 | | #include "sldns/sbuffer.h" |
5 | | |
6 | | struct regional * region = NULL; |
7 | | |
8 | | int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) |
9 | 2.89k | { |
10 | 2.89k | if (!region) { |
11 | 1 | region = regional_create(); |
12 | 1 | if (!region) { |
13 | 0 | abort(); |
14 | 0 | } |
15 | 1 | } |
16 | 2.89k | sldns_buffer pktbuf; |
17 | 2.89k | sldns_buffer_init_frm_data(&pktbuf, (void*)buf, len); |
18 | | |
19 | 2.89k | struct msg_parse prs; |
20 | 2.89k | memset(&prs, 0, sizeof(prs)); |
21 | 2.89k | parse_packet(&pktbuf, &prs, region); |
22 | 2.89k | return 0; |
23 | 2.89k | } |