From c30705f5f01d9fe9dd4c63959ce5690c1ffce9a7 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Fri, 8 Apr 2022 15:57:13 +0800 Subject: [PATCH] libc/lib_glob:use strlcpy instead of memcpy Signed-off-by: anjiahao --- libs/libc/misc/lib_glob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/misc/lib_glob.c b/libs/libc/misc/lib_glob.c index e249f28008..3bf8170c65 100644 --- a/libs/libc/misc/lib_glob.c +++ b/libs/libc/misc/lib_glob.c @@ -328,7 +328,7 @@ static int do_glob(FAR char *buf, size_t pos, int type, FAR char *pat, continue; } - memcpy(buf + pos, de->d_name, l + 1); + strlcpy(buf + pos, de->d_name, l + 1); if (p2) {