]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
xfs: Don't attempt to iterate over empty directory.
authorVladimir Serbinenko <phcoder@gmail.com>
Wed, 30 Aug 2017 13:56:19 +0000 (15:56 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Wed, 30 Aug 2017 13:56:19 +0000 (15:56 +0200)
Reported by: Tuomas Tynkkynen

grub-core/fs/xfs.c

index 9f66dd6e4c6491e6b2cbfc7866335b432c824502..c6031bd3f71e7107743f229e5006e1984c78667c 100644 (file)
@@ -828,6 +828,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
            entries = (grub_be_to_cpu32 (tail->leaf_count)
                       - grub_be_to_cpu32 (tail->leaf_stale));
 
+           if (!entries)
+             continue;
+
            /* Iterate over all entries within this block.  */
            while ((char *)direntry < (char *)tail)
              {