mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
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:
@@ -72,7 +72,7 @@ key_t ftok(FAR const char *pathname, int proj_id)
|
|||||||
|
|
||||||
snprintf(fullpath, PATH_MAX, "%s/",
|
snprintf(fullpath, PATH_MAX, "%s/",
|
||||||
CONFIG_LIBC_FTOK_VFS_PATH);
|
CONFIG_LIBC_FTOK_VFS_PATH);
|
||||||
strlcat(fullpath, pathname, sizeof(fullpath));
|
strlcat(fullpath, pathname, PATH_MAX);
|
||||||
if (stat(fullpath, &st) < 0 && get_errno() == ENOENT)
|
if (stat(fullpath, &st) < 0 && get_errno() == ENOENT)
|
||||||
{
|
{
|
||||||
/* Directory not exist, let's create one for caller */
|
/* Directory not exist, let's create one for caller */
|
||||||
|
|||||||
Reference in New Issue
Block a user