Date: Thu, 9 May 2019 01:16:03 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347376 - stable/11/sys/net Message-ID: <201905090116.x491G3RX020857@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Thu May 9 01:16:03 2019 New Revision: 347376 URL: https://svnweb.freebsd.org/changeset/base/347376 Log: MFC r339121 (tuexen): Use strlcpy() instead of strncpy(). CID: 1395980, 1395981 Modified: stable/11/sys/net/if_tap.c stable/11/sys/net/if_tun.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_tap.c ============================================================================== --- stable/11/sys/net/if_tap.c Wed May 8 23:39:24 2019 (r347375) +++ stable/11/sys/net/if_tap.c Thu May 9 01:16:03 2019 (r347376) @@ -742,7 +742,7 @@ tapioctl(struct cdev *dev, u_long cmd, caddr_t data, i return (EPROTOTYPE); mtx_lock(&tp->tap_mtx); if (ifp->if_mtu != tapp->mtu) { - strncpy(ifr.ifr_name, if_name(ifp), IFNAMSIZ); + strlcpy(ifr.ifr_name, if_name(ifp), IFNAMSIZ); ifr.ifr_mtu = tapp->mtu; CURVNET_SET(ifp->if_vnet); error = ifhwioctl(SIOCSIFMTU, ifp, Modified: stable/11/sys/net/if_tun.c ============================================================================== --- stable/11/sys/net/if_tun.c Wed May 8 23:39:24 2019 (r347375) +++ stable/11/sys/net/if_tun.c Thu May 9 01:16:03 2019 (r347376) @@ -729,7 +729,7 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, i return (EPROTOTYPE); mtx_lock(&tp->tun_mtx); if (TUN2IFP(tp)->if_mtu != tunp->mtu) { - strncpy(ifr.ifr_name, if_name(TUN2IFP(tp)), IFNAMSIZ); + strlcpy(ifr.ifr_name, if_name(TUN2IFP(tp)), IFNAMSIZ); ifr.ifr_mtu = tunp->mtu; CURVNET_SET(TUN2IFP(tp)->if_vnet); error = ifhwioctl(SIOCSIFMTU, TUN2IFP(tp),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905090116.x491G3RX020857>