Coverage Report

Created: 2026-03-09 07:04

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
900
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){
7
    /* Set flb_malloc_mod to be fuzzer-data dependent */
8
900
    if (size < 4) {
9
2
        return 0;
10
2
    }
11
898
    flb_malloc_p = 0;
12
898
    flb_malloc_mod = *(int*)data;
13
898
    data += 4;
14
898
    size -= 4;
15
16
    /* Avoid division by zero for modulo operations */
17
898
    if (flb_malloc_mod == 0) {
18
4
        flb_malloc_mod = 1;
19
4
    }
20
21
898
    if (size != 512)
22
89
        return 0;
23
24
    /* target the conversion of raw msgpack to json */
25
809
    flb_sds_t record;
26
809
    record = flb_msgpack_raw_to_json_sds(data, size, FLB_TRUE);
27
809
    flb_sds_destroy(record);
28
29
809
    return 0;
30
898
}