]> TLD Linux GIT Repositories - packages/grub2.git/blob - grub2-xfs-Fix-termination-loop-for-directory-iteration.patch
- partial PLD merge
[packages/grub2.git] / grub2-xfs-Fix-termination-loop-for-directory-iteration.patch
1 From a7d584c005bde09bb86475a79d714215b3480821 Mon Sep 17 00:00:00 2001
2 From: Jan Kara <jack@suse.cz>
3 Date: Wed, 11 Jun 2014 18:36:59 +0200
4 Subject: [PATCH 2/4] xfs: Fix termination loop for directory iteration
5
6 Directory iteration used wrong position (sizeof wrong structure) for
7 termination of iteration inside a directory block. Luckily the position
8 ended up being wrong by just 1 byte and directory entries are larger so
9 things worked out fine in practice. But fix the problem anyway.
10
11 Signed-off-by: Jan Kara <jack@suse.cz>
12 ---
13  grub-core/fs/xfs.c | 3 +--
14  1 file changed, 1 insertion(+), 2 deletions(-)
15
16 diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
17 index a2fc942707c1..ef3bc787e968 100644
18 --- a/grub-core/fs/xfs.c
19 +++ b/grub-core/fs/xfs.c
20 @@ -608,8 +608,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
21                        - grub_be_to_cpu32 (tail->leaf_stale));
22  
23             /* Iterate over all entries within this block.  */
24 -           while (pos < (dirblk_size
25 -                         - (int) sizeof (struct grub_xfs_dir2_entry)))
26 +           while (pos < tail_start)
27               {
28                 struct grub_xfs_dir2_entry *direntry;
29                 grub_uint8_t *freetag;
30 -- 
31 1.8.1.4
32