Coverage Report

Created: 2026-08-13 07:09

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/janet/test/fuzzers/fuzz_unmarshal.c
Line
Count
Source
1
#include <stdint.h>
2
#include <janet.h>
3
4
/* Disable leak sanitizer */
5
0
int __lsan_is_turned_off(void) {
6
0
    return 1;
7
0
}
8
9
3.18k
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
10
11
    /* init Janet */
12
3.18k
    janet_init();
13
14
    /* fuzz the binary unmarshal (deserialization) path in src/core/marsh.c */
15
3.18k
    JanetTable *reg = janet_env_lookup(janet_core_env(NULL));
16
3.18k
    JanetTryState tstate;
17
3.18k
    if (janet_try(&tstate) == JANET_SIGNAL_OK) {
18
3.18k
        const uint8_t *next = NULL;
19
3.18k
        janet_unmarshal(data, size, 0, reg, &next);
20
3.18k
    }
21
3.18k
    janet_restore(&tstate);
22
23
    /* cleanup Janet */
24
3.18k
    janet_deinit();
25
26
3.18k
    return 0;
27
3.18k
}