* grub-core/efiemu/prepare.c (grub_efiemu_crc): Add missing

zeroing of CRC field before computing CRC.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-28 03:59:08 +01:00
parent 5a6e39c28f
commit dc693fe67c
2 changed files with 7 additions and 0 deletions

View File

@ -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.

View 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);