]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Need to initialize data
authorJohn Ferlan <jferlan@redhat.com>
Mon, 10 Oct 2016 15:08:26 +0000 (11:08 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 10 Oct 2016 19:40:20 +0000 (15:40 -0400)
If not initialized and the virAsprintf to jsonreply or fulllablel fails,
then the call to qemuMonitorTestFree will take stack data.

tests/qemumonitorjsontest.c

index 0574f8c6b993e4f6860b6f78a09dcce4240d5d58..993a373c31cb3c81b53d42e091e2d1a5a57aa6ad 100644 (file)
@@ -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;