mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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>
This commit is contained in:
parent
4c0398b528
commit
2816fe2e84
@ -9105,7 +9105,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainMakeCPUMigratable(def->cpu) < 0)
|
||||
if (def->cpu && qemuDomainMakeCPUMigratable(def->cpu) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user