This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new c30705f5f0 libc/lib_glob:use strlcpy instead of memcpy
c30705f5f0 is described below

commit c30705f5f01d9fe9dd4c63959ce5690c1ffce9a7
Author: anjiahao <[email protected]>
AuthorDate: Fri Apr 8 15:57:13 2022 +0800

    libc/lib_glob:use strlcpy instead of memcpy
    
    Signed-off-by: anjiahao <[email protected]>
---
 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)
         {

Reply via email to