From 2e593ba518a54fbf88a8c5cb564686c87b5864f0 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 7 Oct 2011 20:42:36 -0600 Subject: [PATCH] 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. --- src/lxc/lxc_controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- GitLab