From: Eric Blake Date: Sat, 8 Oct 2011 02:42:36 +0000 (-0600) Subject: lxc: fix logic bug X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2e593ba518a54fbf88a8c5cb564686c87b5864f0;p=libvirt.git lxc: fix logic bug Detected by Coverity. We want to increment the size_t counter, not the pointer to the counter. Bug present since 5f5c6fde (0.9.5). * src/lxc/lxc_controller.c (lxcSetupLoopDevices): Use correct precedence. --- diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 52d382ec1e..51488e755c 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");