mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-14 16:45:20 +00:00
testCompareXMLToArgv: Avoid use of uninitialized 'monitor_chr'
Failure of 'testQemuInfoInitArgs' jumps over the initialization of 'monitor_chr' via memset, which leads to a crash. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f5d8913f91
commit
1bb7b3aa9c
@ -642,14 +642,14 @@ testCompareXMLToArgv(const void *data)
|
|||||||
virArch arch = VIR_ARCH_NONE;
|
virArch arch = VIR_ARCH_NONE;
|
||||||
g_autoptr(virIdentity) sysident = virIdentityGetSystem();
|
g_autoptr(virIdentity) sysident = virIdentityGetSystem();
|
||||||
|
|
||||||
|
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
||||||
|
|
||||||
if (testQemuInfoInitArgs((struct testQemuInfo *) info) < 0)
|
if (testQemuInfoInitArgs((struct testQemuInfo *) info) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (info->arch != VIR_ARCH_NONE && info->arch != VIR_ARCH_X86_64)
|
if (info->arch != VIR_ARCH_NONE && info->arch != VIR_ARCH_X86_64)
|
||||||
qemuTestSetHostArch(&driver, info->arch);
|
qemuTestSetHostArch(&driver, info->arch);
|
||||||
|
|
||||||
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
|
||||||
|
|
||||||
if (!(conn = virGetConnect()))
|
if (!(conn = virGetConnect()))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user