libs/libc/ftok: fix sizeof(char *), after tempbuffer

Catched by coverity, we change full path from stack variable to ptr.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
buxiasen
2025-09-25 12:19:25 +08:00
committed by Xiang Xiao
parent 51bcec53c4
commit 38378149ed
+1 -1
View File
@@ -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 */