Coverage Report

Created: 2026-07-16 07:02

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/jq/tests/jq_fuzz_compile.c
Line
Count
Source
1
#include <stdint.h>
2
#include <stdlib.h>
3
#include <string.h>
4
5
#include "jq.h"
6
7
130
int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
8
  // Creat null-terminated string
9
130
  char *null_terminated = (char *)malloc(size + 1);
10
130
  memcpy(null_terminated, (char *)data, size);
11
130
  null_terminated[size] = '\0';
12
13
  // Fuzzer entrypoint
14
130
  jq_state *jq = NULL;
15
130
  jq = jq_init();
16
130
  if (jq != NULL) {
17
130
    if (jq_compile(jq, null_terminated)) {
18
28
      jq_dump_disassembly(jq, 2);
19
28
    }
20
130
  }
21
130
  jq_teardown(&jq);
22
23
  // Free the null-terminated string
24
130
  free(null_terminated);
25
26
130
  return 0;
27
130
}