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/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 38378149edc libs/libc/ftok: fix sizeof(char *), after tempbuffer
38378149edc is described below

commit 38378149edcc7b767fe4fce4087801288d52271b
Author: buxiasen <[email protected]>
AuthorDate: Thu Sep 25 12:19:25 2025 +0800

    libs/libc/ftok: fix sizeof(char *), after tempbuffer
    
    Catched by coverity, we change full path from stack variable to ptr.
    
    Signed-off-by: buxiasen <[email protected]>
---
 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 */

Reply via email to