mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Fix possible NULL deref in qemuDomainSaveImageStartVM
Commit 075523438 added a direct reference to @cookie even though
it may be NULL as shown by a comment a few lines previous - so add
the check here as well.
Found by Coverity
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
@@ -6831,7 +6831,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
|
||||
qemuDomainFixupCPUs(vm, &cookie->cpu) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!cookie->slirpHelper)
|
||||
if (cookie && !cookie->slirpHelper)
|
||||
priv->disableSlirp = true;
|
||||
|
||||
if (qemuProcessStart(conn, driver, vm, cookie ? cookie->cpu : NULL,
|
||||
|
||||
Reference in New Issue
Block a user