From 1f157561568e326895545ae621b6584dc2e691e4 Mon Sep 17 00:00:00 2001 From: "Alan C. Assis" Date: Tue, 21 Oct 2025 10:06:38 -0300 Subject: [PATCH] fs/fat: Ignore //... sequences in the file path This fixes an issue reported by user harishn6 on github. Signed-off-by: Alan C. Assis --- fs/fat/fs_fat32dirent.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/fat/fs_fat32dirent.c b/fs/fat/fs_fat32dirent.c index b5baa6dca92..ed58c9fa21e 100644 --- a/fs/fat/fs_fat32dirent.c +++ b/fs/fat/fs_fat32dirent.c @@ -362,6 +362,13 @@ static inline int fat_parsesfname(FAR const char **path, #ifdef CONFIG_FAT_LCNAMES dirinfo->fd_ntflags = ntlcfound & ntlcenable; #endif + /* Ignore sequences of //... in the filename */ + + while (node && *node == '/') + { + node++; + } + *terminator = ch; *path = node; return OK;