mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +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;
|
||||
g_autoptr(virIdentity) sysident = virIdentityGetSystem();
|
||||
|
||||
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
||||
|
||||
if (testQemuInfoInitArgs((struct testQemuInfo *) info) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (info->arch != VIR_ARCH_NONE && info->arch != VIR_ARCH_X86_64)
|
||||
qemuTestSetHostArch(&driver, info->arch);
|
||||
|
||||
memset(&monitor_chr, 0, sizeof(monitor_chr));
|
||||
|
||||
if (!(conn = virGetConnect()))
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user