mirror of
https://github.com/apache/nuttx.git
synced 2026-08-28 21:00:44 +00:00
The _inode_checkpath function uses `namelen < NAME_MAX` to validate path segment lengths. When a filename is exactly NAME_MAX characters long and is followed by more path segments (e.g. /dir/), the loop exits with namelen == NAME_MAX before processing the '/' separator, causing a spurious ENAMETOOLONG error. Per POSIX, NAME_MAX is the maximum number of bytes in a filename not including the terminating null, so a filename of exactly NAME_MAX characters is valid. Change the condition to `namelen <= NAME_MAX` so the loop can process the trailing '/' separator and correctly reset namelen for the next path segment. Signed-off-by: wangxingxing <wangxingxing@xiaomi.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| fs_files.c | ||
| fs_foreachinode.c | ||
| fs_inode.c | ||
| fs_inodeaddref.c | ||
| fs_inodebasename.c | ||
| fs_inodefind.c | ||
| fs_inodefree.c | ||
| fs_inodegetpath.c | ||
| fs_inoderelease.c | ||
| fs_inoderemove.c | ||
| fs_inodereserve.c | ||
| fs_inodesearch.c | ||
| inode.h | ||
| Make.defs | ||