Initialise jq_state->input_cb{,_data} to NULL in jq_init()
Before adoption: this commit came in with the history the project adopted, so no landing records it.
To avoid causing segmentation faults when input/1 is called in a jq_state on which jq_set_input_cb() has not been called; e.g. the one used by jq --run-tests. That segfault could also be fixed in run_jq_tests() by calling: jq_set_input_cb(jq, NULL, NULL); But I think it makes sense to just make jq_init() initialise those values to NULL.
authored by Emanuele Torre · committed by Nico Williams · parent 1cb9ba3 · Browse files · 2 files+10 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Ref: https://github.com/jqlang/jq/pull/2717#discussion_r1264338841
Diff stats
2 files+10 added−0 removed
- tests:+7 added−0 removed
- other:+3 added−0 removed