From: John Ferlan Date: Thu, 27 Sep 2018 10:54:12 +0000 (-0400) Subject: lxc: Only check @nparams in lxcDomainBlockStatsFlags X-Git-Tag: v4.9.0-rc1~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6830c8130781c8be141190bd66963b9a13cd69ca;p=thirdparty%2Flibvirt.git lxc: Only check @nparams in lxcDomainBlockStatsFlags Remove the "!params" check from the condition since it's possible someone could pass a non NULL value there, but a 0 for the nparams and thus continue on. The external API only checks if @nparams is non-zero, then check for NULL @params. Found by Coverity Signed-off-by: John Ferlan ACKed-by: Michal Privoznik --- diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index d95ed63c18..f732305649 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -2388,7 +2388,7 @@ lxcDomainBlockStatsFlags(virDomainPtr dom, /* We don't return strings, and thus trivially support this flag. */ flags &= ~VIR_TYPED_PARAM_STRING_OKAY; - if (!params && !*nparams) { + if (!*nparams) { *nparams = LXC_NB_DOMAIN_BLOCK_STAT_PARAM; return 0; }