]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Ensure argv passed by createl to create is NULL terminated
authorDwight Engen <dwight.engen@oracle.com>
Mon, 26 Nov 2012 17:18:13 +0000 (12:18 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 26 Nov 2012 18:14:18 +0000 (13:14 -0500)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index ac995a6e9e4068db5609ccb8a0fdacacf49fe4a9..ed2c483022649212e26ee183e3d65bd642a348c6 100644 (file)
@@ -686,13 +686,14 @@ static bool lxcapi_createl(struct lxc_container *c, char *t, ...)
                if (!arg)
                        break;
                nargs++;
-               temp = realloc(args, nargs * sizeof(*args));
+               temp = realloc(args, (nargs+1) * sizeof(*args));
                if (!temp)
                        goto out;
                args = temp;
                args[nargs - 1] = arg;
        }
        va_end(ap);
+       args[nargs] = NULL;
 
        bret = c->create(c, t, args);