提交 4e02d52a 编写于 作者: J John Ferlan

qemu: Fix possible NULL deref in qemuDomainGetResctrlMonData

If virQEMUDriverGetCapabilities returns NULL, then a subsequent
deref of @caps would cause an error, so we just return failure.

Found by Coverity
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 a067b781
...@@ -20728,7 +20728,8 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver, ...@@ -20728,7 +20728,8 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver,
size_t i = 0; size_t i = 0;
size_t j = 0; size_t j = 0;
caps = virQEMUDriverGetCapabilities(driver, false); if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
return -1;
switch (tag) { switch (tag) {
case VIR_RESCTRL_MONITOR_TYPE_CACHE: case VIR_RESCTRL_MONITOR_TYPE_CACHE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册