SHA256
1
0
forked from pool/grub2
grub2/grub2-getroot-fix-get-btrfs-fs-prefix-big-endian.patch

26 lines
857 B
Diff

Index: grub-2.02~beta2/grub-core/osdep/linux/getroot.c
===================================================================
--- grub-2.02~beta2.orig/grub-core/osdep/linux/getroot.c
+++ grub-2.02~beta2/grub-core/osdep/linux/getroot.c
@@ -324,9 +324,9 @@ get_btrfs_fs_prefix (const char *mount_p
tree_id = sargs.buf[2];
br = (struct grub_btrfs_root_backref *) (sargs.buf + 4);
- inode_id = br->inode_id;
+ inode_id = grub_le_to_cpu64 (br->inode_id);
name = br->name;
- namelen = br->n;
+ namelen = grub_le_to_cpu16 (br->n);
}
else
{
@@ -353,7 +353,7 @@ get_btrfs_fs_prefix (const char *mount_p
ir = (struct grub_btrfs_inode_ref *) (sargs.buf + 4);
name = ir->name;
- namelen = ir->n;
+ namelen = grub_le_to_cpu16 (ir->n);
}
old = ret;
ret = xmalloc (namelen + (old ? strlen (old) : 0) + 2);