[PATCH 18/23] Avoid uninitialized data in qemuMonitorTestNew

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The virDomainChrSourceDef variable should be memset to
0, so that the cleanup block does not free uninitialized
data on OOM.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 tests/qemumonitortestutils.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index 9568476..bca3385 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -878,6 +878,8 @@ qemuMonitorTestNew(bool json,
     qemuMonitorTestPtr test = NULL;
     virDomainChrSourceDef src;
 
+    memset(&src, 0, sizeof(src));
+
     if (!(test = qemuMonitorCommonTestNew(xmlopt, vm, &src)))
         goto error;
 
@@ -915,6 +917,8 @@ qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt)
     qemuMonitorTestPtr test = NULL;
     virDomainChrSourceDef src;
 
+    memset(&src, 0, sizeof(src));
+
     if (!(test = qemuMonitorCommonTestNew(xmlopt, NULL, &src)))
         goto error;
 
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]