Blame SOURCES/0167-xfs-Fix-termination-loop-for-directory-iteration.patch

d41074
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a85e8e
From: Jan Kara <jack@suse.cz>
a85e8e
Date: Mon, 14 Jul 2014 17:21:29 +0200
d41074
Subject: [PATCH] xfs: Fix termination loop for directory iteration
a85e8e
a85e8e
Directory iteration used wrong position (sizeof wrong structure) for
a85e8e
termination of iteration inside a directory block. Luckily the position
a85e8e
ended up being wrong by just 1 byte and directory entries are larger so
a85e8e
things worked out fine in practice. But fix the problem anyway.
a85e8e
a85e8e
Signed-off-by: Jan Kara <jack@suse.cz>
a85e8e
---
a85e8e
 grub-core/fs/xfs.c | 3 +--
a85e8e
 1 file changed, 1 insertion(+), 2 deletions(-)
a85e8e
a85e8e
diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
d41074
index 16ffd3f1ebd..4bd52d1e081 100644
a85e8e
--- a/grub-core/fs/xfs.c
a85e8e
+++ b/grub-core/fs/xfs.c
a85e8e
@@ -603,8 +603,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
a85e8e
 		       - grub_be_to_cpu32 (tail->leaf_stale));
a85e8e
 
a85e8e
 	    /* Iterate over all entries within this block.  */
a85e8e
-	    while (pos < (dirblk_size
a85e8e
-			  - (int) sizeof (struct grub_xfs_dir2_entry)))
a85e8e
+	    while (pos < tail_start)
a85e8e
 	      {
a85e8e
 		struct grub_xfs_dir2_entry *direntry;
a85e8e
 		grub_uint8_t *freetag;