[PATCH] lxc: fix logic bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Detected by Coverity.  We want to increment the size_t counter,
not the pointer to the counter.

* src/lxc/lxc_controller.c (lxcSetupLoopDevices): Use correct
precedence.
---

Pushing under the trivial rule.

 src/lxc/lxc_controller.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 52d382e..51488e7 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -210,7 +210,7 @@ static int lxcSetupLoopDevices(virDomainDefPtr def, size_t *nloopDevs, int **loo
             virReportOOMError();
             goto cleanup;
         }
-        (*loopDevs)[*nloopDevs++] = fd;
+        (*loopDevs)[(*nloopDevs)++] = fd;
     }

     VIR_DEBUG("Setup all loop devices");
-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]