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 committed by Vincent Batts
parent 2da5f067f4
commit 88a43b3f8c

View file

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