Function is_async_return() added by commit
940cc30d0d4 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: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
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,