From d7798fd0aba4068e847bcb71ac6cf0148ef2e61e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=92=A6=E8=A1=97?= <15390014138@163.com> Date: Tue, 20 Apr 2021 22:16:09 +0800 Subject: [PATCH] update fs/vfs/path_cache.c. --- fs/vfs/path_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/vfs/path_cache.c b/fs/vfs/path_cache.c index 5cd4afb1..c76eab56 100644 --- a/fs/vfs/path_cache.c +++ b/fs/vfs/path_cache.c @@ -107,7 +107,7 @@ struct PathCache *PathCacheAlloc(struct Vnode *parent, struct Vnode *vnode, cons return NULL; } - ret = strncpy_s(nc->name, pathCacheSize, name, len); + ret = strncpy_s(nc->name, len + 1, name, len); if (ret != LOS_OK) { return NULL; }