From: Christian Brauner Date: Fri, 15 Jun 2018 10:43:48 +0000 (+0200) Subject: coverity: #1425825 X-Git-Tag: lxc-2.0.10~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea7f7cb042eb56df07fd85f262465c808298b828;p=thirdparty%2Flxc.git coverity: #1425825 Unchecked return value Signed-off-by: Christian Brauner --- diff --git a/src/lxc/network.c b/src/lxc/network.c index a262693e5..d6c224e54 100755 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -123,7 +123,10 @@ static int instantiate_veth(struct lxc_handler *handler, struct lxc_netdev *netd 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); if (!veth2) goto out_delete;