mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-11 12:25:52 +00:00
qemu: Fix crash in qemuBuildDeviceCommandlineHandleOverrides
'STREQ' is used to compare the override alias with the device alias.
While the parser ensures that the override alias is non-NULL, the device
alias may be NULL and STREQ doesn't handle that.
Fixes: 38ab5c9ead
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/321
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8d3a807a4a
commit
95bd137216
@ -240,6 +240,10 @@ qemuBuildDeviceCommandlineHandleOverrides(virJSONValue *props,
|
||||
const char *alias = virJSONValueObjectGetString(props, "id");
|
||||
size_t i;
|
||||
|
||||
/* If the device doesn't have an alias we can't override its props */
|
||||
if (!alias)
|
||||
return;
|
||||
|
||||
for (i = 0; i < nsdef->ndeviceOverride; i++) {
|
||||
qemuDomainXmlNsDeviceOverride *dev = nsdef->deviceOverride + i;
|
||||
size_t j;
|
||||
|
Loading…
Reference in New Issue
Block a user