From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 5/5] monitor: Fix tracepoint crash on JSON syntax error
Date: Mon, 16 Jul 2018 16:05:14 +0200 [thread overview]
Message-ID: <20180716140514.1490-6-armbru@redhat.com> (raw)
In-Reply-To: <20180716140514.1490-1-armbru@redhat.com>
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 <armbru@redhat.com>
Message-Id: <20180716091012.29510-1-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Xu <peterx@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
next prev parent reply other threads:[~2018-07-16 14:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 14:05 [Qemu-devel] [PULL 0/5] Miscellaneous patches for 2018-07-16 (3.0.0-rc1) Markus Armbruster
2018-07-16 14:05 ` [Qemu-devel] [PULL 1/5] qapi: Do not expose "allow-preconfig" in query-qmp-schema Markus Armbruster
2018-07-16 14:05 ` [Qemu-devel] [PULL 2/5] cli qmp: Mark --preconfig, exit-preconfig experimental Markus Armbruster
2018-07-16 14:05 ` [Qemu-devel] [PULL 3/5] qemu-doc: Move appendix "Deprecated features" to its own file Markus Armbruster
2018-07-16 14:05 ` [Qemu-devel] [PULL 4/5] MAINTAINERS: New section "Incompatible changes", copy libvir-list Markus Armbruster
2018-07-16 14:05 ` Markus Armbruster [this message]
2018-07-16 16:18 ` [Qemu-devel] [PULL 0/5] Miscellaneous patches for 2018-07-16 (3.0.0-rc1) Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180716140514.1490-6-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).