[libvirt] [PATCH] qemu: Don't access uninitialized memory

Martin Kletzander mkletzan at redhat.com
Wed Mar 16 09:48:45 UTC 2016


Very early ping, I know, but it's almost trivial and it fixes a crash
when running domxml-to-native.

On Fri, Mar 11, 2016 at 02:25:16PM +0100, Martin Kletzander wrote:
>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 at redhat.com>
>---
> 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 a0d6596aef7b..e868b9f899e7 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;
>--
>2.7.3
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160316/0d84a6bc/attachment-0001.sig>


More information about the libvir-list mailing list