Initialise jq_state->debug_cb{,_data} to NULL
To make debug/0 not call an uninitialised function pointer when using --run-tests or when using a jq_state on which jq_set_debug_cb() has not been called.
This commit is contained in:
1 parent
9e4c71558a
commit
bb0f898c01
2 files changed
+8
-1
No files matched your search
@@ -1015,6 +1015,9 @@ jq_state *jq_init(void) {
|
|||||||
jq->input_cb = NULL;
|
jq->input_cb = NULL;
|
||||||
jq->input_cb_data = NULL;
|
jq->input_cb_data = NULL;
|
||||||
|
|
||||||
|
jq->debug_cb = NULL;
|
||||||
|
jq->debug_cb_data = NULL;
|
||||||
|
|
||||||
jq->err_cb = default_err_cb;
|
jq->err_cb = default_err_cb;
|
||||||
jq->err_cb_data = stderr;
|
jq->err_cb_data = stderr;
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -1820,8 +1820,12 @@ tojson | fromjson
|
|||||||
{"a":null}
|
{"a":null}
|
||||||
|
|
||||||
|
|
||||||
# calling input/1 in a test doesn't crash jq
|
# calling input/0, or debug/0 in a test doesn't crash jq
|
||||||
|
|
||||||
try input catch .
|
try input catch .
|
||||||
null
|
null
|
||||||
"break"
|
"break"
|
||||||
|
|
||||||
|
debug
|
||||||
|
1
|
||||||
|
1
|
||||||
Reference in new issue
Block a user