diff options
author | DavidKorczynski <david@adalogics.com> | 2023-12-03 16:54:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-03 17:54:25 +0100 |
commit | 20a403e97eb0d951b00934939469f6d8f4163601 (patch) | |
tree | ca23c744b9049e2bd321a08e56a6ee367872c53f | |
parent | 693a7261e5ebccaf0c74fde0ac48700ba3d52f17 (diff) |
jq_fuzz_execute.cpp: fix false assert
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64632 by following the suggestion here: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64632#c2 -- the issue is fixed when this attribute is set.
I did not add any of the other suggestions in the comment: we haven't run into these issues in the fuzzer so far.
-rw-r--r-- | tests/jq_fuzz_execute.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/jq_fuzz_execute.cpp b/tests/jq_fuzz_execute.cpp index 66a044f3..fafebdb9 100644 --- a/tests/jq_fuzz_execute.cpp +++ b/tests/jq_fuzz_execute.cpp @@ -16,6 +16,8 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { jq_state *jq = NULL; jq = jq_init(); if (jq != NULL) { + jq_set_attr(jq, jv_string("JQ_ORIGIN"), jv_string("/tmp/")); + if (jq_compile(jq, prog_payload.c_str())) { // Process to jv_parse and then jv_next jv input = jv_parse(parse_payload1.c_str()); |