]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/efiemu/prepare.c (grub_efiemu_crc): Add missing
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 28 Feb 2012 02:59:08 +0000 (03:59 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 28 Feb 2012 02:59:08 +0000 (03:59 +0100)
zeroing of CRC field before computing CRC.

ChangeLog
grub-core/efiemu/prepare.c

index 73d23caf5d55246a79f0219be001a573896db839..542a8c6112795285f08b5ef7846844bde5cc48ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-27  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/efiemu/prepare.c (grub_efiemu_crc): Add missing
+       zeroing of CRC field before computing CRC.
+
 2012-02-27  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/lib/relocator.c (malloc_in_range): Fix memory leak.
index 5c31464906696f53ab2002b14af43b6c90e32760..2aef8634dec70c11d116d9771f0f268fbf71ac33 100644 (file)
@@ -133,6 +133,7 @@ SUFFIX (grub_efiemu_crc) (void)
   runtime_services = (struct SUFFIX (grub_efiemu_runtime_services) *)
        ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off);
 
+  runtime_services->hdr.crc32 = 0;
   GRUB_MD_CRC32->init(crc32_context);
   GRUB_MD_CRC32->write(crc32_context, runtime_services, runtime_services->hdr.header_size);
   GRUB_MD_CRC32->final(crc32_context);
@@ -145,6 +146,7 @@ SUFFIX (grub_efiemu_crc) (void)
     return err;
 
   /* compute CRC32 of system table */
+  SUFFIX (grub_efiemu_system_table)->hdr.crc32 = 0;
   GRUB_MD_CRC32->init(crc32_context);
   GRUB_MD_CRC32->write(crc32_context, SUFFIX (grub_efiemu_system_table),
                      SUFFIX (grub_efiemu_system_table)->hdr.header_size);