提交 38ea116e 编写于 作者: M Matthias Bolte

esx: Initialize all instances of esxVMX_Data to zero

To avoid using or freeing uninitialized memory or pointers.
上级 b2534529
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册