mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-03 02:15:23 +00:00
xen_hypervisor.c: avoid NULL deref for NULL domain argument
* src/xen/xen_hypervisor.c (xenHypervisorGetVcpus): Don't attempt to diagnose an unlikely NULL-domain or NULL-domain->conn error.
This commit is contained in:
parent
23d6abd23b
commit
b62bf7a700
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* xen_internal.c: direct access to Xen hypervisor level
|
* xen_internal.c: direct access to Xen hypervisor level
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
|
* Copyright (C) 2005-2010 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* See COPYING.LIB for the License of this software
|
* See COPYING.LIB for the License of this software
|
||||||
*
|
*
|
||||||
@ -3477,11 +3477,8 @@ xenHypervisorGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
|
|||||||
virVcpuInfoPtr ipt;
|
virVcpuInfoPtr ipt;
|
||||||
int nbinfo, i;
|
int nbinfo, i;
|
||||||
|
|
||||||
if (domain == NULL || domain->conn == NULL) {
|
if (domain == NULL || domain->conn == NULL)
|
||||||
virXenErrorFunc (domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__,
|
|
||||||
"invalid argument", 0);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
|
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
|
||||||
if (priv->handle < 0 || (domain->id < 0) ||
|
if (priv->handle < 0 || (domain->id < 0) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user