From 71fa2eb26c18c53d9e498e5f75c6307003e72c8e Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Fri, 11 Mar 2016 14:21:56 +0100 Subject: [PATCH] qemu: Don't access uninitialized memory 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 --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 29c3bc8f8a..877ef20708 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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;