Skip to content
Myr

Initialise jq_state->debug_cb{,_data} to NULL

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by Emanuele Torre · committed by Nico Williams · parent 9e4c715 · Browse files · 2 files+8 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−1 removed

  • tests:+5 added−1 removed
  • other:+3 added−0 removed

2 files+8 added−1 removed

modified:src/execute.c+3 added
1013 unmodified lines
10141015 jq->input_cb = NULL;1016 jq->input_cb_data = NULL;10171018 jq->debug_cb = NULL;1019 jq->debug_cb_data = NULL;10201021 jq->err_cb = default_err_cb;1022 jq->err_cb_data = stderr;10231024 jq->attrs = jv_object();
251 unmodified lines
modified:tests/jq.test+5 added-1 removed
1818 unmodified lines
1819{"a":nan}1820{"a":null}182118221823# calling input/1 in a test doesn't crash jq1823# calling input/0, or debug/0 in a test doesn't crash jq18241825try input catch .1826null1827"break"18281829debug1830118311