/src/tarantool/test/fuzz/xrow_header_decode_fuzzer.c
Line | Count | Source (jump to first uncovered line) |
1 | | #include "box/iproto_constants.h" |
2 | | #include "box/xrow.h" |
3 | | #include "memory.h" |
4 | | |
5 | | void |
6 | 0 | cord_on_yield(void) {} |
7 | | |
8 | | __attribute__((constructor)) |
9 | | static void |
10 | | setup(void) |
11 | 2 | { |
12 | 2 | memory_init(); |
13 | 2 | } |
14 | | |
15 | | __attribute__((destructor)) |
16 | | static void |
17 | | teardown(void) |
18 | 0 | { |
19 | 0 | memory_free(); |
20 | 0 | } |
21 | | |
22 | | int |
23 | | LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) |
24 | 5.44k | { |
25 | 5.44k | const char *p = (const char *)data; |
26 | 5.44k | const char *pe = (const char *)data + size; |
27 | 5.44k | if (mp_check(&p, pe) != 0) |
28 | 1.38k | return -1; |
29 | | |
30 | 4.06k | struct xrow_header header; |
31 | 4.06k | xrow_decode(&header, &p, pe, false); |
32 | | |
33 | 4.06k | return 0; |
34 | 5.44k | } |