[bug][dfs] rt_strlen(name) + 1) -> DFS_PATH_MAX
This commit is contained in:
parent
8fccef5894
commit
d1d9c492f8
|
@ -647,7 +647,7 @@ int dfs_elm_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count)
|
|||
|
||||
d->d_namlen = (rt_uint8_t)rt_strlen(fn);
|
||||
d->d_reclen = (rt_uint16_t)sizeof(struct dirent);
|
||||
rt_strncpy(d->d_name, fn, rt_strlen(fn) + 1);
|
||||
rt_strncpy(d->d_name, fn, DFS_PATH_MAX);
|
||||
|
||||
index ++;
|
||||
if (index * sizeof(struct dirent) >= count)
|
||||
|
|
|
@ -1119,7 +1119,7 @@ int nfs_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count)
|
|||
|
||||
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);
|
||||
|
||||
index ++;
|
||||
if (index * sizeof(struct dirent) >= count)
|
||||
|
|
|
@ -276,7 +276,7 @@ int dfs_romfs_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count)
|
|||
|
||||
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->pos;
|
||||
|
|
Loading…
Reference in New Issue