xfs: Fix termination loop for directory iteration

Directory iteration used wrong position (sizeof wrong structure) for
termination of iteration inside a directory block. Luckily the position
ended up being wrong by just 1 byte and directory entries are larger so
things worked out fine in practice. But fix the problem anyway.

Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Jan Kara 2014-07-14 17:21:29 +02:00 committed by Andrei Borzenkov
parent 07258815e9
commit 1570140f03

View file

@ -603,8 +603,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
- grub_be_to_cpu32 (tail->leaf_stale)); - grub_be_to_cpu32 (tail->leaf_stale));
/* Iterate over all entries within this block. */ /* Iterate over all entries within this block. */
while (pos < (dirblk_size while (pos < tail_start)
- (int) sizeof (struct grub_xfs_dir2_entry)))
{ {
struct grub_xfs_dir2_entry *direntry; struct grub_xfs_dir2_entry *direntry;
grub_uint8_t *freetag; grub_uint8_t *freetag;