[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/4] QMP: Check "arguments" member's type
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 4/4] QMP: Check "arguments" member's type |
Date: |
Wed, 7 Apr 2010 15:25:10 -0300 |
Otherwise the following input crashes QEMU:
{ "execute": "migrate", "arguments": "tcp:0:4446" }
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/monitor.c b/monitor.c
index cd350d6..91d7da5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4522,6 +4522,9 @@ static void handle_qmp_command(JSONMessageParser *parser,
QList *tokens)
obj = qdict_get(input, "arguments");
if (!obj) {
args = qdict_new();
+ } else if (qobject_type(obj) != QTYPE_QDICT) {
+ qerror_report(QERR_QMP_BAD_INPUT_OBJECT_MEMBER, "arguments", "object");
+ goto err_input;
} else {
args = qobject_to_qdict(obj);
QINCREF(args);
--
1.7.0.4.297.g6555b1