]> git.ipfire.org Git - thirdparty/qemu.git/commit
qapi: handle visitor->type_size() in QapiDeallocVisitor
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 26 Nov 2012 12:10:12 +0000 (13:10 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 3 Dec 2012 21:02:28 +0000 (15:02 -0600)
commit54c6c5a35d8bd57b320bbba8b85604018004bd13
tree12f348a033769339f428157a67a06909a3a3f8f3
parentf05a3da4e00d24c4540811e6fff2c4f0484771bd
qapi: handle visitor->type_size() in QapiDeallocVisitor

visit_type_size() requires either visitor->type_size() or
visitor_uint64() to be implemented, otherwise a NULL function pointer is
invoked.

It is possible to trigger this crash as follows:

  $ qemu-system-x86_64 -netdev tap,sndbuf=0,id=netdev0 \
                       -device virtio-blk-pci,netdev=netdev0

The 'sndbuf' option has type "size".

Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 0c26f2eca40d6c65ea9edc62a10e510dc7f65cc8)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qapi/qapi-dealloc-visitor.c