From 38378149edcc7b767fe4fce4087801288d52271b Mon Sep 17 00:00:00 2001 From: buxiasen Date: Thu, 25 Sep 2025 12:19:25 +0800 Subject: [PATCH] libs/libc/ftok: fix sizeof(char *), after tempbuffer Catched by coverity, we change full path from stack variable to ptr. Signed-off-by: buxiasen --- libs/libc/misc/lib_ftok.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/misc/lib_ftok.c b/libs/libc/misc/lib_ftok.c index ed35966a298..56cb7b4e80d 100644 --- a/libs/libc/misc/lib_ftok.c +++ b/libs/libc/misc/lib_ftok.c @@ -72,7 +72,7 @@ key_t ftok(FAR const char *pathname, int proj_id) snprintf(fullpath, PATH_MAX, "%s/", CONFIG_LIBC_FTOK_VFS_PATH); - strlcat(fullpath, pathname, sizeof(fullpath)); + strlcat(fullpath, pathname, PATH_MAX); if (stat(fullpath, &st) < 0 && get_errno() == ENOENT) { /* Directory not exist, let's create one for caller */