]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Don't access uninitialized memory
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 11 Mar 2016 13:21:56 +0000 (14:21 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 16 Mar 2016 09:49:12 +0000 (10:49 +0100)
In qemuConnectDomainXMLToNative() we set up the monitor, but we never
memset() it to zeros.  Thanks to the introduction of the logfile
parameter of chardevs (and the logfile member of the struct), we started
checking whether that's non-NULL and that exposed this old error.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_driver.c

index 29c3bc8f8af7606912037d643952a4b8c06e4f59..877ef207080ab6d8203ade193b16b011e3469c0d 100644 (file)
@@ -6950,7 +6950,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
 {
     virQEMUDriverPtr driver = conn->privateData;
     virDomainDefPtr def = NULL;
-    virDomainChrSourceDef monConfig;
+    virDomainChrSourceDef monConfig = {0};
     virQEMUCapsPtr qemuCaps = NULL;
     bool monitor_json = false;
     virCommandPtr cmd = NULL;