Date: Mon, 10 Aug 2020 15:41:44 -0700 From: Ravi Pokala <rpokala@freebsd.org> To: Mateusz Guzik <mjg@FreeBSD.org>, <src-committers@freebsd.org>, <svn-src-all@freebsd.org>, <svn-src-head@freebsd.org> Subject: Re: svn commit: r364071 - head/sys/kern Message-ID: <B1DCE6F5-7B6E-45A1-8A43-11E04A37145A@panasas.com> In-Reply-To: <202008101040.07AAeEtt096924@repo.freebsd.org> References: <202008101040.07AAeEtt096924@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
-----Original Message----- From: <owner-src-committers@freebsd.org> on behalf of Mateusz Guzik <mjg@FreeBSD.org> Date: 2020-08-10, Monday at 03:40 To: <src-committers@freebsd.org>, <svn-src-all@freebsd.org>, <svn-src-head@freebsd.org> Subject: svn commit: r364071 - head/sys/kern Author: mjg Date: Mon Aug 10 10:40:14 2020 New Revision: 364071 URL: https://svnweb.freebsd.org/changeset/base/364071 Log: cache: strlcpy -> memcpy But why? -Ravi (rpokala@) Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Aug 10 10:37:16 2020 (r364070) +++ head/sys/kern/vfs_cache.c Mon Aug 10 10:40:14 2020 (r364071) @@ -1934,7 +1934,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, } len = ncp->nc_nlen = cnp->cn_namelen; hash = cache_get_hash(cnp->cn_nameptr, len, dvp); - strlcpy(ncp->nc_name, cnp->cn_nameptr, len + 1); + memcpy(ncp->nc_name, cnp->cn_nameptr, len); + ncp->nc_name[len] = '\0'; cache_enter_lock(&cel, dvp, vp, hash); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B1DCE6F5-7B6E-45A1-8A43-11E04A37145A>