[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1352967209-29616-4-git-send-email-wenqing.lz@taobao.com>
Date: Thu, 15 Nov 2012 16:13:25 +0800
From: Zheng Liu <gnehzuil.liu@...il.com>
To: linux-ext4@...r.kernel.org, tytso@....edu
Cc: Zheng Liu <wenqing.lz@...bao.com>
Subject: [PATCH 3/7] libext2fs: wrong loop will cause dir entry is not found in dirsearch command
From: Zheng Liu <wenqing.lz@...bao.com>
It needs to iterate dir entry until offset is greater than or equal to size of
inline data. But currently it is only iterate until offset >= len (length of
name).
Signed-off-by: Zheng Liu <wenqing.lz@...bao.com>
---
lib/ext2fs/inline_data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/ext2fs/inline_data.c b/lib/ext2fs/inline_data.c
index f0473fd..7f5ec3e 100644
--- a/lib/ext2fs/inline_data.c
+++ b/lib/ext2fs/inline_data.c
@@ -129,7 +129,7 @@ static int do_search_dir(ext2_filsys fs, void *start, int size,
unsigned rec_len;
errcode_t errcode;
- while (offset < len) {
+ while (offset < size) {
de = (struct ext2_dir_entry *)(start + offset);
errcode = ext2fs_get_rec_len(fs, de, &rec_len);
if (errcode) {
--
1.7.12.rc2.18.g61b472e
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists