mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06: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:
parent
a9416dc62c
commit
1f41a645b6
2 changed files with 8 additions and 5 deletions
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue