]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Fix NULL ptr dereference caused by qemuDomainDefFormatBufInternal
authorErik Skultety <eskultet@redhat.com>
Mon, 18 Nov 2019 12:46:14 +0000 (13:46 +0100)
committerErik Skultety <eskultet@redhat.com>
Mon, 18 Nov 2019 13:32:49 +0000 (14:32 +0100)
commit2816fe2e846ab3bd2bfbef123c426a17f1e1df98
tree0f3c5937adef3375b8b6d0fcbb6b46ab2da90080
parent4c0398b5284d14c55eca51095673b6fadbbd85fb
qemu: Fix NULL ptr dereference caused by qemuDomainDefFormatBufInternal

qemuDomainDefFormatBufInternal function wasn't testing whether the CPU
was actually defined in the XML and saving such a domain resulted in the
following backtrace:

0 in qemuDomainMakeCPUMigratable (cpu=0x0)
1 in qemuDomainDefFormatBufInternal()
2 in qemuDomainDefFormatXMLInternal()
3 in qemuDomainDefFormatLive()
4 in qemuDomainSaveInternal()
5 in qemuDomainSaveFlags()
6 in qemuDomainSave()
7 in virDomainSave()

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/qemu/qemu_domain.c