diff options
| author | geniusgogo <[email protected]> | 2023-11-23 14:15:24 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2023-11-23 06:20:17 -0500 |
| commit | 5a438c818aefb2e314cce2c16a024aaf6ff97234 (patch) | |
| tree | 9510534bf4e5857f402f0f256a0f1ee81c801ca4 /components/dfs/dfs_v2/filesystems/romfs | |
| parent | 26fbe01adaf80594239effb130b8bda35a53a06c (diff) | |
fix dfsv2 romfs dfs_romfs_getdents buffer overflow.
Diffstat (limited to 'components/dfs/dfs_v2/filesystems/romfs')
| -rw-r--r-- | components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c b/components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c index 43db9b6ec3..9e9a537421 100644 --- a/components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c @@ -352,7 +352,7 @@ static int dfs_romfs_getdents(struct dfs_file *file, struct dirent *dirp, uint32 d->d_namlen = rt_strlen(name); d->d_reclen = (rt_uint16_t)sizeof(struct dirent); - rt_strncpy(d->d_name, name, rt_strlen(name) + 1); + rt_strncpy(d->d_name, name, DFS_PATH_MAX); /* move to next position */ ++ file->fpos; |
