Date: Fri, 20 May 2016 06:56:43 +0000 (UTC) From: Don Lewis <truckman@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300279 - stable/10/usr.sbin/lmcconfig Message-ID: <201605200656.u4K6uhZs091158@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: truckman Date: Fri May 20 06:56:43 2016 New Revision: 300279 URL: https://svnweb.freebsd.org/changeset/base/300279 Log: MFC 299866 Use strlcpy() instead of strncpy() when copying ifname to ensure that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 974852 Modified: stable/10/usr.sbin/lmcconfig/lmcconfig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/lmcconfig/lmcconfig.c ============================================================================== --- stable/10/usr.sbin/lmcconfig/lmcconfig.c Fri May 20 06:54:59 2016 (r300278) +++ stable/10/usr.sbin/lmcconfig/lmcconfig.c Fri May 20 06:56:43 2016 (r300279) @@ -222,7 +222,7 @@ call_driver(unsigned long cmd, struct io { int error = 0; - strncpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); + strlcpy(iohdr->ifname, ifname, sizeof(iohdr->ifname)); iohdr->cookie = NGM_LMC_COOKIE; iohdr->iohdr = iohdr;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605200656.u4K6uhZs091158>