When tracepoint handle_qmp_command is enabled, we crash on JSON syntax errors. Broken in commit 1cc37471525. Fix by skipping the tracepoint on JSON syntax error. Before the flawed commit, we skipped it by returning early.
Fixes: CID 1394216 Signed-off-by: Markus Armbruster <arm...@redhat.com> --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 7af1f18d13..be29634a00 100644 --- a/monitor.c +++ b/monitor.c @@ -4224,7 +4224,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens) qdict_del(qdict, "id"); } /* else will fail qmp_dispatch() */ - if (trace_event_get_state_backends(TRACE_HANDLE_QMP_COMMAND)) { + if (req && trace_event_get_state_backends(TRACE_HANDLE_QMP_COMMAND)) { QString *req_json = qobject_to_json(req); trace_handle_qmp_command(mon, qstring_get_str(req_json)); qobject_unref(req_json); -- 2.17.1