]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Avoid crash in qemuDiskGetActualType
authorPeter Krempa <pkrempa@redhat.com>
Wed, 22 Jan 2014 09:27:52 +0000 (10:27 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 22 Jan 2014 10:33:31 +0000 (11:33 +0100)
commit7f0fd427413fe04963b1bcb158cf70e980ad1842
tree17542f36f45172adad0c551076781a5c5b7eea04
parentdeb924dda8d64bfe724114c7c5f5dccb56e2dd9f
qemu: Avoid crash in qemuDiskGetActualType

Libvirtd would crash if a domain contained an empty cdrom drive of
type='volume' as the disk def->srcpool member would be dereferenced. Fix
it by checking if the source pool is present before dereferencing it.

Also alter tests to catch this issue in the future.

Reported by: Kevin Shanahan
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1056328
src/qemu/qemu_conf.c
tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args
tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml