* grub-core/fs/hfs.c (grub_hfs_find_node): Handle unaligned keys.
(grub_hfs_iterate_dir): Likewise.
This commit is contained in:
parent
12e9d4d152
commit
b453412d2f
2 changed files with 7 additions and 5 deletions
|
@ -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>
|
2011-12-13 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
Fix video on platforms where unaligned access is forbidden.
|
Fix video on platforms where unaligned access is forbidden.
|
||||||
|
|
|
@ -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
|
entry. In case of a non-leaf mode it will be used to lookup
|
||||||
the rest of the tree. */
|
the rest of the tree. */
|
||||||
if (cmp <= 0)
|
if (cmp <= 0)
|
||||||
{
|
found = grub_be_to_cpu32 (grub_get_unaligned32 (rec->data));
|
||||||
grub_uint32_t *node = (grub_uint32_t *) rec->data;
|
|
||||||
found = grub_be_to_cpu32 (*node);
|
|
||||||
}
|
|
||||||
else /* The key can not be found in the tree. */
|
else /* The key can not be found in the tree. */
|
||||||
return 1;
|
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;
|
struct grub_hfs_catalog_key *ckey = rec->key;
|
||||||
|
|
||||||
if (grub_hfs_cmp_catkeys (rec->key, (void *) &key) <= 0)
|
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)
|
if (hnd->type == 0xFF && ckey->strlen > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue