OSDN Git Service

qapi: Fix string input visitor handling of invalid list
authorEric Blake <eblake@redhat.com>
Thu, 28 Apr 2016 21:45:30 +0000 (15:45 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 12 May 2016 07:47:55 +0000 (09:47 +0200)
commit74f24cb6306d065045d0e2215a7d10533fa59c57
tree341b74274658e68eba25ff4d4031659d6f1cb0f3
parent7337468385f0ad258657b2ce76ac0a7306f9f186
qapi: Fix string input visitor handling of invalid list

As shown in the previous commit, the string input visitor was
treating bogus input as an empty list rather than an error.
Fix parse_str() to set errp, then the callers to exit early if
an error was reported.

Meanwhile, fix the testsuite to use the generated
qapi_free_int16List() instead of rolling our own, and to
validate the fixed behavior, while at the same time documenting
one more change that we'd like to make in a later patch (a
failed visit_start_list should guarantee a NULL pointer,
regardless of what things were on input).

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1461879932-9020-23-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
qapi/string-input-visitor.c
tests/test-string-input-visitor.c