Coverage Report

Created: 2025-11-29 06:11

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
965
int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
8
  // Creat null-terminated string
9
965
  char *null_terminated = (char *)malloc(size + 1);
10
965
  memcpy(null_terminated, (char *)data, size);
11
965
  null_terminated[size] = '\0';
12
13
  // Fuzzer entrypoint
14
965
  jq_state *jq = NULL;
15
965
  jq = jq_init();
16
965
  if (jq != NULL) {
17
965
    if (jq_compile(jq, null_terminated)) {
18
266
      jq_dump_disassembly(jq, 2);
19
266
    }
20
965
  }
21
965
  jq_teardown(&jq);
22
23
  // Free the null-terminated string
24
965
  free(null_terminated);
25
26
965
  return 0;
27
965
}