From: John Ferlan Date: Thu, 4 Sep 2014 14:12:13 +0000 (-0400) Subject: qemu: Resolve Coverity REVERSE_INULL X-Git-Tag: CVE-2014-3633~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f845b1115f0b5be1554893f1b9ca2d5a3b8c7cd;p=thirdparty%2Flibvirt.git qemu: Resolve Coverity REVERSE_INULL Coverity complains that checking for !domlist after setting doms = domlist and making a deref of doms just above It seems the call in question was intended to me made in the case that 'doms' was passed in and not when the virDomainObjListExport() call allocated domlist and already called virConnectGetAllDomainStatsCheckACL(). Thus rather than check for !domlist - check that "doms != domlist" in order to avoid the Coverity message. Signed-off-by: John Ferlan --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 184691d899..b47d00f91a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17402,7 +17402,7 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, if (!(dom = qemuDomObjFromDomain(doms[i]))) continue; - if (!domlist && + if (doms != domlist && !virConnectGetAllDomainStatsCheckACL(conn, dom->def)) continue;