coverity: #1426126

Unchecked return value Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent fa456191
...@@ -1657,7 +1657,10 @@ static int lxc_spawn(struct lxc_handler *handler) ...@@ -1657,7 +1657,10 @@ static int lxc_spawn(struct lxc_handler *handler)
DEBUG("Preserved cgroup namespace via fd %d", ret); DEBUG("Preserved cgroup namespace via fd %d", ret);
} }
snprintf(pidstr, 20, "%d", handler->pid); ret = snprintf(pidstr, 20, "%d", handler->pid);
if (ret < 0 || ret >= 20)
goto out_delete_net;
if (setenv("LXC_PID", pidstr, 1)) if (setenv("LXC_PID", pidstr, 1))
SYSERROR("Failed to set environment variable: LXC_PID=%s.", pidstr); SYSERROR("Failed to set environment variable: LXC_PID=%s.", pidstr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment