mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: monitor: Fix device matching in qemuMonitorJSONBlockIoThrottleInfo
We should compare the alias/qdev id only when it was provided by the caller and when it was found in the reply. Otherwise we could dereference a NULL pointer. STRNEQ_NULLABLE is not appropriate since it would return 'true' if the string was not present in the JSON output. Found by Coverity. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
8aced2ea32
commit
2cad501bcb
@ -5001,8 +5001,8 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((drivealias && STRNEQ(current_drive, drivealias)) ||
|
if ((drivealias && current_drive && STRNEQ(current_drive, drivealias)) ||
|
||||||
(qdevid && STRNEQ(current_qdev, qdevid)))
|
(qdevid && current_qdev && STRNEQ(current_qdev, qdevid)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user