From 6f5d5ee865df705edbcf29a5c530db157dfdeba2 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 4 May 2012 17:13:24 +0200 Subject: [PATCH] * grub-core/fs/squash4.c (grub_squash_inode): Fix offset field. (grub_squash_read_data): Fix offset byte-swapping. --- ChangeLog | 5 +++++ grub-core/fs/squash4.c | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6eb6bba66..aa5ad3a22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-04 Vladimir Serbinenko + + * grub-core/fs/squash4.c (grub_squash_inode): Fix offset field. + (grub_squash_read_data): Fix offset byte-swapping. + 2012-05-04 Vladimir Serbinenko * grub-core/kern/misc.c (grub_strcmp): Use unsigned comparison as diff --git a/grub-core/fs/squash4.c b/grub-core/fs/squash4.c index ae4be35e4..6516c6287 100644 --- a/grub-core/fs/squash4.c +++ b/grub-core/fs/squash4.c @@ -86,8 +86,7 @@ struct grub_squash_inode struct { grub_uint32_t chunk; grub_uint32_t fragment; - grub_uint16_t offset; - grub_uint16_t dummy; + grub_uint32_t offset; grub_uint32_t size; grub_uint32_t block_size[0]; } __attribute__ ((packed)) file; @@ -96,8 +95,7 @@ struct grub_squash_inode grub_uint64_t size; grub_uint32_t dummy1[3]; grub_uint32_t fragment; - grub_uint16_t offset; - grub_uint16_t dummy2; + grub_uint32_t offset; grub_uint32_t dummy3; grub_uint32_t block_size[0]; } __attribute__ ((packed)) long_file; @@ -860,7 +858,7 @@ grub_squash_read_data (struct grub_squash_data *data, a += grub_le_to_cpu64 (frag.offset); compressed = !(frag.size & SQUASH_BLOCK_UNCOMPRESSED); if (ino->ino.type == grub_cpu_to_le16_compile_time (SQUASH_TYPE_LONG_REGULAR)) - b = grub_le_to_cpu64 (ino->ino.long_file.offset) + off; + b = grub_le_to_cpu32 (ino->ino.long_file.offset) + off; else b = grub_le_to_cpu32 (ino->ino.file.offset) + off;