]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/squash4.c (grub_squash_inode): Fix offset field.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 4 May 2012 15:13:24 +0000 (17:13 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 4 May 2012 15:13:24 +0000 (17:13 +0200)
(grub_squash_read_data): Fix offset byte-swapping.

ChangeLog
grub-core/fs/squash4.c

index 6eb6bba669dde352452a77c2508913d679d3ede4..aa5ad3a221a501e36fd1cd0990109773372c3cb6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-04  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/squash4.c (grub_squash_inode): Fix offset field.
+       (grub_squash_read_data): Fix offset byte-swapping.
+
 2012-05-04  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/misc.c (grub_strcmp): Use unsigned comparison as
index ae4be35e4471e89bd309bc4d9169786fc6b5a640..6516c6287b2f0d1650a126a53e927563bbc980ba 100644 (file)
@@ -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;