]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lxc: Only check @nparams in lxcDomainBlockStatsFlags
authorJohn Ferlan <jferlan@redhat.com>
Thu, 27 Sep 2018 10:54:12 +0000 (06:54 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 1 Oct 2018 18:27:07 +0000 (14:27 -0400)
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 <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
src/lxc/lxc_driver.c

index d95ed63c1878178f1e3c041a4a53e114d2f90b5b..f7323056499b7f719c42c7b40048f4db15f86ff4 100644 (file)
@@ -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;
     }