提交 82617d7c 编写于 作者: L Luiz Capitulino 提交者: Blue Swirl

Monitor: Fix command execution regression

Function is_async_return() added by commit 940cc30d assumes
that 'data', which is returned by handlers, is always a QDict.

This is not true, as QLists can also be returned, in this case
we'll get a segfault.

Fix that by checking if 'data' is a QDict.
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 8f4efc55
......@@ -3700,7 +3700,11 @@ static void monitor_print_error(Monitor *mon)
static int is_async_return(const QObject *data)
{
return data && qdict_haskey(qobject_to_qdict(data), "__mon_async");
if (data && qobject_type(data) == QTYPE_QDICT) {
return qdict_haskey(qobject_to_qdict(data), "__mon_async");
}
return 0;
}
static void monitor_call_handler(Monitor *mon, const mon_cmd_t *cmd,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册