From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1X6i4g-0003QF-7W for mharc-grub-devel@gnu.org; Mon, 14 Jul 2014 11:21:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6i4X-0003Ij-Kt for grub-devel@gnu.org; Mon, 14 Jul 2014 11:21:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6i4O-00085F-Hh for grub-devel@gnu.org; Mon, 14 Jul 2014 11:21:45 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44320 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6i4O-00084W-CE for grub-devel@gnu.org; Mon, 14 Jul 2014 11:21:36 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EC498AC37 for ; Mon, 14 Jul 2014 15:21:34 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 7328081ED9; Mon, 14 Jul 2014 17:21:33 +0200 (CEST) From: Jan Kara To: grub-devel@gnu.org Subject: [PATCH 2/4] xfs: Fix termination loop for directory iteration Date: Mon, 14 Jul 2014 17:21:29 +0200 Message-Id: <1405351291-24767-3-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1405351291-24767-1-git-send-email-jack@suse.cz> References: <1405351291-24767-1-git-send-email-jack@suse.cz> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: Jan Kara X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2014 15:21:52 -0000 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 --- grub-core/fs/xfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c index a2fc942707c1..ef3bc787e968 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -608,8 +608,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, - grub_be_to_cpu32 (tail->leaf_stale)); /* Iterate over all entries within this block. */ - while (pos < (dirblk_size - - (int) sizeof (struct grub_xfs_dir2_entry))) + while (pos < tail_start) { struct grub_xfs_dir2_entry *direntry; grub_uint8_t *freetag; -- 1.8.1.4