]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-06-15 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Sun, 15 Jun 2008 13:31:18 +0000 (13:31 +0000)
committerrobertmh <robertmh@localhost>
Sun, 15 Jun 2008 13:31:18 +0000 (13:31 +0000)
        * fs/sfs.c (grub_sfs_read_extent): Fix the count of nodes in
        extent-btree which is written as big endian on disk.
        Reported by Alain Greppin  <al@chilibi.org>.

ChangeLog
fs/sfs.c

index 8913063dba8cfca0b3f8755b2df2e59f75bcb0f0..94e95fdef0c1d5a02f721bfc6ac50115446317c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-15  Robert Millan  <rmh@aybabtu.com>
+
+       * fs/sfs.c (grub_sfs_read_extent): Fix the count of nodes in
+       extent-btree which is written as big endian on disk.
+       Reported by Alain Greppin  <al@chilibi.org>.
+
 2008-06-14  Robert Millan  <rmh@aybabtu.com>
 
        * util/i386/efi/grub-install.in (modules): Remove `_chain'.
index 82a0a9ec88639f289a4d2a8fc9fcbbb4ab74b521..c92e57cfd0ae9abfc7f496bbd695e99cd84ecc71 100644 (file)
--- a/fs/sfs.c
+++ b/fs/sfs.c
@@ -1,7 +1,7 @@
 /* sfs.c - Amiga Smart FileSystem.  */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2005,2006,2007  Free Software Foundation, Inc.
+ *  Copyright (C) 2005,2006,2007,2008  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -172,7 +172,7 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block,
          return grub_errno;
        }
 
-      for (i = 0; i < tree->nodes; i++)
+      for (i = 0; i < grub_be_to_cpu16 (tree->nodes); i++)
        {
 
 #define EXTNODE(tree, index)                                           \
@@ -189,7 +189,7 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block,
 
          /* In case the last node is reached just use that one, it is
             the right match.  */
-         if (i + 1 == tree->nodes && !tree->leaf)
+         if (i + 1 == grub_be_to_cpu16 (tree->nodes) && !tree->leaf)
            {
              next = grub_be_to_cpu32 (EXTNODE (tree, i)->data);
              break;