coverity: #1425825

Unchecked return value Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 2cbd1ca5
...@@ -123,7 +123,10 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd ...@@ -123,7 +123,10 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd
memcpy(netdev->priv.veth_attr.veth1, veth1, IFNAMSIZ); memcpy(netdev->priv.veth_attr.veth1, veth1, IFNAMSIZ);
} }
snprintf(veth2buf, sizeof(veth2buf), "vethXXXXXX"); err = snprintf(veth2buf, sizeof(veth2buf), "vethXXXXXX");
if (err < 0 || (size_t)err >= sizeof(veth2buf))
return -1;
veth2 = lxc_mkifname(veth2buf); veth2 = lxc_mkifname(veth2buf);
if (!veth2) if (!veth2)
goto out_delete; goto out_delete;
......
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