]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/hfs.c (grub_hfs_find_node): Handle unaligned keys.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 13 Dec 2011 22:10:38 +0000 (23:10 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 13 Dec 2011 22:10:38 +0000 (23:10 +0100)
(grub_hfs_iterate_dir): Likewise.

ChangeLog
grub-core/fs/hfs.c

index 2134b481a8a0f9e2df47f0bb971cfd82983f5a98..936e64c45d7f6f9110329ff438cf270164480c51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-13  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/hfs.c (grub_hfs_find_node): Handle unaligned keys.
+       (grub_hfs_iterate_dir): Likewise.
+
 2011-12-13  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Fix video on platforms where unaligned access is forbidden.
index 973a2d2ef313f8e0fdefd376a9893c465df6fd72..6c5c4da3ed6dfd46b9b30667d805474b0cab2fd0 100644 (file)
@@ -750,10 +750,7 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key,
         entry.  In case of a non-leaf mode it will be used to lookup
         the rest of the tree.  */
       if (cmp <= 0)
-       {
-         grub_uint32_t *node = (grub_uint32_t *) rec->data;
-         found = grub_be_to_cpu32 (*node);
-       }
+       found = grub_be_to_cpu32 (grub_get_unaligned32 (rec->data));
       else /* The key can not be found in the tree. */
        return 1;
 
@@ -817,7 +814,7 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx,
       struct grub_hfs_catalog_key *ckey = rec->key;
 
       if (grub_hfs_cmp_catkeys (rec->key, (void *) &key) <= 0)
-       found = grub_be_to_cpu32 (*(grub_uint32_t *) rec->data);
+       found = grub_be_to_cpu32 (grub_get_unaligned32 (rec->data));
 
       if (hnd->type == 0xFF && ckey->strlen > 0)
        {