This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 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 95e4561145f tools: rp2040: Drop uninitialized name length check
95e4561145f is described below
commit 95e4561145f626420bd03b81efe8e3beb9fd75e1
Author: aineoae86-sys <[email protected]>
AuthorDate: Mon Jul 6 04:05:05 2026 +0800
tools: rp2040: Drop uninitialized name length check
scan_dir() checked name_len before assigning it. Directory entries already
compute and validate strlen(a_dirent->d_name) before allocating the dir item,
while the root path passed to scan_dir() is not encoded as a directory entry
name.
Remove the stale pre-opendir check so scan_dir() no longer branches on an
uninitialized local variable.
Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <[email protected]>
---
tools/rp2040/make_flash_fs.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/tools/rp2040/make_flash_fs.c b/tools/rp2040/make_flash_fs.c
index ba2b0e0007e..190d4293b89 100644
--- a/tools/rp2040/make_flash_fs.c
+++ b/tools/rp2040/make_flash_fs.c
@@ -237,12 +237,6 @@ int scan_dir(int in_sector)
struct stat stat;
int name_len;
- if (name_len > max_name_len)
- {
- fprintf(stderr, "directory name to big. skipped. (%s)\n", path);
- return -1;
- }
-
input_dir = opendir(path);
if (input_dir == NULL)