]> xenbits.xensource.com Git - libvirt.git/commit
qemuDomainSetupDisk: Initialize 'targetPaths'
authorPeter Krempa <pkrempa@redhat.com>
Tue, 25 Jan 2022 16:49:00 +0000 (17:49 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 26 Jan 2022 08:24:59 +0000 (09:24 +0100)
commitddb2384f0c78a91c40d95afdbc7fe325e95ef2bc
treec19d15039cfb58fc1566742f5233b75390c54e89
parent7d54a291383b42f302f9f68508c933fb6987f20b
qemuDomainSetupDisk: Initialize 'targetPaths'

Compiler isn't able to see that 'virDevMapperGetTargets' in cases e.g.
when the devmapper isn't available may not initialize the value in the
pointer passed as the second argument.

The usage 'qemuDomainSetupDisk' lead to an accidental infinite loop as
previous calls apparently doctored the stack to a point where
'g_slist_concat' would end up in an infinite loop trying to find the end
of the list.

Fixes: 6c49c2ee9fcb88de02cdc333f666a8e95d60a3b0
Closes: https://gitlab.com/libvirt/libvirt/-/issues/268
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/qemu/qemu_namespace.c