diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2010-04-06 16:39:42 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2010-04-26 11:17:19 -0300 |
commit | 04f8c053cca9c329eebb761f3a1ffef3d349b84c (patch) | |
tree | f46d68dba72583e2714d790a82dfd6fced1b6f3c /monitor.c | |
parent | QError: Improve QERR_QMP_BAD_INPUT_OBJECT desc (diff) | |
download | qemu-kvm-04f8c053cca9c329eebb761f3a1ffef3d349b84c.tar.gz qemu-kvm-04f8c053cca9c329eebb761f3a1ffef3d349b84c.tar.bz2 qemu-kvm-04f8c053cca9c329eebb761f3a1ffef3d349b84c.zip |
QMP: Check "arguments" member's type
Otherwise the following input crashes QEMU:
{ "execute": "migrate", "arguments": "tcp:0:4446" }
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -4437,6 +4437,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); |