coverity: #1425766

Unchecked return value Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 1f080b1d
...@@ -900,6 +900,7 @@ static bool criu_ok(struct lxc_container *c, char **criu_version) ...@@ -900,6 +900,7 @@ static bool criu_ok(struct lxc_container *c, char **criu_version)
static bool restore_net_info(struct lxc_container *c) static bool restore_net_info(struct lxc_container *c)
{ {
int ret;
struct lxc_list *it; struct lxc_list *it;
bool has_error = true; bool has_error = true;
...@@ -913,7 +914,9 @@ static bool restore_net_info(struct lxc_container *c) ...@@ -913,7 +914,9 @@ static bool restore_net_info(struct lxc_container *c)
if (netdev->type != LXC_NET_VETH) if (netdev->type != LXC_NET_VETH)
continue; continue;
snprintf(template, sizeof(template), "vethXXXXXX"); ret = snprintf(template, sizeof(template), "vethXXXXXX");
if (ret < 0 || ret >= sizeof(template))
goto out_unlock;
if (netdev->priv.veth_attr.pair[0] == '\0' && if (netdev->priv.veth_attr.pair[0] == '\0' &&
netdev->priv.veth_attr.veth1[0] == '\0') { netdev->priv.veth_attr.veth1[0] == '\0') {
......
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