From c571b99545b713bf8119502ec80f49bcae69596f Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Mon, 10 Aug 2020 10:40:14 +0000 Subject: [PATCH] cache: strlcpy -> memcpy --- sys/kern/vfs_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 1c51c4907ab9..e6718a9994f5 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1934,7 +1934,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, } 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); /*