xfs: Don't attempt to iterate over empty directory.

Reported by: Tuomas Tynkkynen
This commit is contained in:
Vladimir Serbinenko 2017-08-30 15:56:19 +02:00
parent e75cf4a58b
commit c42acc23ff
1 changed files with 3 additions and 0 deletions

View 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)
{