Coverage Report

Created: 2026-06-20 07:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/fluent-bit/tests/internal/fuzzers/msgpack_parse_fuzzer.c
Line
Count
Source
1
#include <stdint.h>
2
#include <stdlib.h>
3
#include <msgpack.h>
4
#include <fluent-bit/flb_pack.h>
5
6
919
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){
7
    /* Set flb_malloc_mod to be fuzzer-data dependent */
8
919
    if (size < 4) {
9
2
        return 0;
10
2
    }
11
917
    flb_malloc_p = 0;
12
917
    flb_malloc_mod = *(int*)data;
13
917
    data += 4;
14
917
    size -= 4;
15
16
    /* Avoid division by zero for modulo operations */
17
917
    if (flb_malloc_mod == 0) {
18
5
        flb_malloc_mod = 1;
19
5
    }
20
21
917
    if (size != 512)
22
101
        return 0;
23
24
    /* target the conversion of raw msgpack to json */
25
816
    flb_sds_t record;
26
816
    record = flb_msgpack_raw_to_json_sds(data, size, FLB_TRUE);
27
816
    flb_sds_destroy(record);
28
29
816
    return 0;
30
917
}