[libvirt] [PATCH 7/7] tests: Need to initialize data

John Ferlan jferlan at redhat.com
Mon Oct 10 15:42:18 UTC 2016


If not initialized and the virAsprintf to jsonreply or fulllablel fails,
then the call to qemuMonitorTestFree will take stack data.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 tests/qemumonitorjsontest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 0574f8c..993a373 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -753,7 +753,7 @@ qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionPtr xmlopt,
                                     bool fail)
 
 {
-    struct qemuMonitorJSONTestAttachChardevData data;
+    struct qemuMonitorJSONTestAttachChardevData data = {0};
     char *jsonreply = NULL;
     char *fulllabel = NULL;
     int ret = -1;
-- 
2.7.4




More information about the libvir-list mailing list