mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 07:13:42 +00:00
coverity: #1425764
Unchecked return value Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
477e62b618
commit
4250ef64b3
@ -1561,15 +1561,24 @@ static bool create_run_template(struct lxc_container *c, char *tpath,
|
||||
|
||||
/* note n2[n2args-1] is NULL */
|
||||
n2[n2args - 5] = "--mapped-uid";
|
||||
snprintf(txtuid, 20, "%d", hostuid_mapped);
|
||||
|
||||
ret = snprintf(txtuid, 20, "%d", hostuid_mapped);
|
||||
if (ret < 0 || ret >= 20) {
|
||||
free(newargv);
|
||||
free(n2);
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
n2[n2args - 4] = txtuid;
|
||||
n2[n2args - 3] = "--mapped-gid";
|
||||
|
||||
ret = snprintf(txtgid, 20, "%d", hostgid_mapped);
|
||||
if (ret < 0 || ret >= 20) {
|
||||
free(newargv);
|
||||
free(n2);
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
n2[n2args - 2] = txtgid;
|
||||
n2[n2args - 1] = NULL;
|
||||
free(newargv);
|
||||
|
Loading…
Reference in New Issue
Block a user