mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
esx: Initialize all instances of esxVMX_Data to zero
To avoid using or freeing uninitialized memory or pointers.
This commit is contained in:
parent
b253452942
commit
38ea116eba
@ -2698,10 +2698,11 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
|
||||
char *vmx = NULL;
|
||||
virVMXContext ctx;
|
||||
esxVMX_Data data;
|
||||
data.datastorePathWithoutFileName = NULL;
|
||||
virDomainDefPtr def = NULL;
|
||||
char *xml = NULL;
|
||||
|
||||
memset(&data, 0, sizeof (data));
|
||||
|
||||
if (esxVI_EnsureSession(priv->primary) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
@ -2805,6 +2806,8 @@ esxDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
|
||||
virDomainDefPtr def = NULL;
|
||||
char *xml = NULL;
|
||||
|
||||
memset(&data, 0, sizeof (data));
|
||||
|
||||
if (STRNEQ(nativeFormat, "vmware-vmx")) {
|
||||
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
||||
_("Unsupported config format '%s'"), nativeFormat);
|
||||
@ -2844,6 +2847,8 @@ esxDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
|
||||
virDomainDefPtr def = NULL;
|
||||
char *vmx = NULL;
|
||||
|
||||
memset(&data, 0, sizeof (data));
|
||||
|
||||
if (STRNEQ(nativeFormat, "vmware-vmx")) {
|
||||
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
||||
_("Unsupported config format '%s'"), nativeFormat);
|
||||
@ -3066,6 +3071,8 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
|
||||
char *taskInfoErrorMessage = NULL;
|
||||
virDomainPtr domain = NULL;
|
||||
|
||||
memset(&data, 0, sizeof (data));
|
||||
|
||||
if (esxVI_EnsureSession(priv->primary) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user