unicorn/qemu/qapi
Marc-André Lureau 1a138915a5
qapi: Fix crash when 'any' or 'null' parameter is missing
Unlike the other visit methods, visit_type_any() and visit_type_null()
neglect to check whether qmp_input_get_object() succeeded. They crash
when it fails. Reproducer:

{ "execute": "qom-set",
"arguments": { "path": "/machine", "property": "rtc-time" } }

Will crash with:

qapi/qapi-visit-core.c:277: visit_type_any: Assertion `!err != !*obj'
failed

Broken in commit 5c678ee. Fix by adding the missing error checks.

Backports commit c489780203f9b22aca5539ec7589b7140bdc951f from qemu
2018-02-26 05:13:54 -05:00
..
common.json qapi: Add alias for ErrorClass 2018-02-19 20:38:51 -05:00
Makefile.objs qapi: Add new clone visitor 2018-02-25 01:34:12 -05:00
qapi-clone-visitor.c qapi: Add new clone visitor 2018-02-25 01:34:12 -05:00
qapi-dealloc-visitor.c qapi: Add new visit_free() function 2018-02-25 01:05:41 -05:00
qapi-visit-core.c qapi: Add new clone visitor 2018-02-25 01:34:12 -05:00
qmp-input-visitor.c qapi: Fix crash when 'any' or 'null' parameter is missing 2018-02-26 05:13:54 -05:00
qmp-output-visitor.c qapi: change QmpOutputVisitor to QSLIST 2018-02-25 19:59:16 -05:00
string-input-visitor.c string-input-visitor: Favor new visit_free() function 2018-02-25 01:08:04 -05:00