mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
qapi: Fix object input visit beyond end of list
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1488544368-30622-28-git-send-email-armbru@redhat.com>
This commit is contained in:
@ -122,10 +122,15 @@ static QObject *qobject_input_try_get_object(QObjectInputVisitor *qiv,
|
||||
} else {
|
||||
assert(qobject_type(qobj) == QTYPE_QLIST);
|
||||
assert(!name);
|
||||
ret = qlist_entry_obj(tos->entry);
|
||||
assert(ret);
|
||||
if (tos->entry) {
|
||||
ret = qlist_entry_obj(tos->entry);
|
||||
if (consume) {
|
||||
tos->entry = qlist_next(tos->entry);
|
||||
}
|
||||
} else {
|
||||
ret = NULL;
|
||||
}
|
||||
if (consume) {
|
||||
tos->entry = qlist_next(tos->entry);
|
||||
tos->index++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user