From 1bad139f88d18b8e26d2b77abe5c8735f866799f Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 31 Jul 2020 02:51:05 +0800 Subject: [PATCH] fs/romfs: Support the path with tail '/' correctly Signed-off-by: Xiang Xiao Change-Id: I7ea668e50e68cb384d013349a2c8cfc2844f3b73 --- fs/romfs/fs_romfsutil.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c index bb6123de51..92b24b793f 100644 --- a/fs/romfs/fs_romfsutil.c +++ b/fs/romfs/fs_romfsutil.c @@ -751,6 +751,11 @@ int romfs_finddirentry(struct romfs_mountpt_s *rm, entrylen = terminator - entryname; } + if (entrylen == 0) + { + return OK; + } + /* Long path segment names will be truncated to NAME_MAX */ if (entrylen > NAME_MAX)