[syslinux:master] ntfs: check for index entry which has INDEX_ENTRY_END flag set

syslinux-bot for Paulo Alcantara pcacjr at gmail.com
Fri Feb 24 10:45:45 PST 2012


Commit-ID:  b6a5884738450626ee1a9ab63e0710de7c879b75
Gitweb:     http://www.syslinux.org/commit/b6a5884738450626ee1a9ab63e0710de7c879b75
Author:     Paulo Alcantara <pcacjr at gmail.com>
AuthorDate: Sat, 11 Feb 2012 23:14:54 -0300
Committer:  Paulo Alcantara <pcacjr at gmail.com>
CommitDate: Sat, 11 Feb 2012 23:14:54 -0300

ntfs: check for index entry which has INDEX_ENTRY_END flag set

In ntfs_readdir(), if one entry has INDEX_ENTRY_END flag set, it won't
contain indexed_file member, that'd be used afterwards when looking for
the MFT record that is associated with that index entry.

Signed-off-by: Paulo Alcantara <pcacjr at gmail.com>

---
 core/fs/ntfs/ntfs.c |   10 +++++++++-
 core/fs/ntfs/ntfs.h |    2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/core/fs/ntfs/ntfs.c b/core/fs/ntfs/ntfs.c
index 0f6cc44..500d0fd 100644
--- a/core/fs/ntfs/ntfs.c
+++ b/core/fs/ntfs/ntfs.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Paulo Alcantara <pcacjr at gmail.com>
+ * Copyright (C) 2011-2012 Paulo Alcantara <pcacjr at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1181,6 +1181,14 @@ idx_block_next_entry:
     }
 
     readdir_state->entries_count++;
+
+    /* Need to check if this entry has INDEX_ENTRY_END flag set. If
+     * so, then it won't contain a indexed_file file, so continue the
+     * lookup on the next VCN/LCN (if any).
+     */
+    if (ie->flags & INDEX_ENTRY_END)
+        goto next_vcn;
+
     len = ntfs_cvt_filename(filename, ie);
     if (!is_filename_printable(filename))
         goto idx_block_next_entry;
diff --git a/core/fs/ntfs/ntfs.h b/core/fs/ntfs/ntfs.h
index c6aa074..721a78d 100644
--- a/core/fs/ntfs/ntfs.h
+++ b/core/fs/ntfs/ntfs.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Paulo Alcantara <pcacjr at gmail.com>
+ * Copyright (C) 2011-2012 Paulo Alcantara <pcacjr at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by


More information about the Syslinux-commits mailing list