mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 13:31:27 +00:00
Ensure argv passed by createl to create is NULL terminated
Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
d95db067d2
commit
83cab6e068
@ -686,13 +686,14 @@ static bool lxcapi_createl(struct lxc_container *c, char *t, ...)
|
|||||||
if (!arg)
|
if (!arg)
|
||||||
break;
|
break;
|
||||||
nargs++;
|
nargs++;
|
||||||
temp = realloc(args, nargs * sizeof(*args));
|
temp = realloc(args, (nargs+1) * sizeof(*args));
|
||||||
if (!temp)
|
if (!temp)
|
||||||
goto out;
|
goto out;
|
||||||
args = temp;
|
args = temp;
|
||||||
args[nargs - 1] = arg;
|
args[nargs - 1] = arg;
|
||||||
}
|
}
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
args[nargs] = NULL;
|
||||||
|
|
||||||
bret = c->create(c, t, args);
|
bret = c->create(c, t, args);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user