libc/lib_glob:use strlcpy instead of memcpy

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2022-04-08 15:57:13 +08:00 committed by Xiang Xiao
parent 5ec4df2cc6
commit c30705f5f0

View File

@ -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)
{