]> git.ipfire.org Git - thirdparty/qemu.git/commit
qapi: Fix crash when 'any' or 'null' parameter is missing
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 22 Sep 2016 20:39:26 +0000 (00:39 +0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 2 Nov 2016 23:18:54 +0000 (18:18 -0500)
commitb34c7bd463ef1453b8661a7b59146c462bb1c621
tree02ebfd7697913a745f2b545705ae18c65431a0ea
parentf3467f56c14fe745b11ae9b37bb081c0967999d4
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.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20160922203927.28241-3-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message rephrased]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit c489780203f9b22aca5539ec7589b7140bdc951f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qapi/qmp-input-visitor.c