From 83cab6e068b64f733dbdd156319b7716b054853a Mon Sep 17 00:00:00 2001 From: Dwight Engen Date: Mon, 26 Nov 2012 12:18:13 -0500 Subject: [PATCH] Ensure argv passed by createl to create is NULL terminated Signed-off-by: Dwight Engen Acked-by: Serge E. Hallyn --- src/lxc/lxccontainer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index ac995a6e9..ed2c48302 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -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);