mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 23:49:36 +00:00
tests: Cover input visit beyond end of list
When you try to visit beyond the end of a list, the qobject input visitor crashes, and the string visitor screws returns garbage. The generated list visits never go beyond the list end, but manual visits could. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1488544368-30622-27-git-send-email-armbru@redhat.com>
This commit is contained in:
@ -948,6 +948,16 @@ static void test_visitor_in_fail_list(TestInputVisitorData *data,
|
||||
visit_check_list(v, &err);
|
||||
error_free_or_abort(&err);
|
||||
visit_end_list(v, NULL);
|
||||
|
||||
/* Visit beyond end of list */
|
||||
v = visitor_input_test_init(data, "[]");
|
||||
|
||||
visit_start_list(v, NULL, NULL, 0, &error_abort);
|
||||
#if 0 /* FIXME crash */
|
||||
visit_type_int(v, NULL, &i64, &err);
|
||||
error_free_or_abort(&err);
|
||||
#endif
|
||||
visit_end_list(v, NULL);
|
||||
}
|
||||
|
||||
static void test_visitor_in_fail_list_nested(TestInputVisitorData *data,
|
||||
|
Reference in New Issue
Block a user