mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 12:56:46 +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)
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user