From 6fa1251a91ef0ac8e3dfdc022e7c7c53bbac12a8 Mon Sep 17 00:00:00 2001 From: marco_g Date: Sat, 15 Oct 2005 21:33:38 +0000 Subject: [PATCH] 2005-10-15 Marco Gerards * fs/xfs.c (grub_xfs_iterate_dir): Detect an error if part of a directory can not be read. --- ChangeLog | 5 +++++ conf/i386-pc.mk | 4 ++-- fs/xfs.c | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1661b169..9c2039641 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-15 Marco Gerards + + * fs/xfs.c (grub_xfs_iterate_dir): Detect an error if part of a + directory can not be read. + 2005-10-15 Yoshinori K. Okuji * configure.ac (AC_INIT): Increase the version number to 1.91. diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 27cf39e11..8403363d9 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -728,8 +728,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/timeout.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ disk/loopback.c \ - fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c \ - fs/iso9660.c fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c \ + fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ + fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ diff --git a/fs/xfs.c b/fs/xfs.c index 44b1cec07..e7a1e7a94 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -418,6 +418,8 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, numread = grub_xfs_read_file (dir, 0, blk << dir->data->sblock.log2_bsize, dir->data->bsize, dirblock); + if (numread != dir->data->bsize) + return 0; entries = (grub_be_to_cpu32 (tail->leaf_count) - grub_be_to_cpu32 (tail->leaf_stale));