* grub-core/loader/i386/bsd.c: Remove variable length arrays.
This commit is contained in:
parent
3ea0ccb319
commit
d5bab2c0e1
2 changed files with 13 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2013-11-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/loader/i386/bsd.c: Remove variable length arrays.
|
||||||
|
|
||||||
2013-11-12 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-11-12 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/efiemu/prepare.c: Remove variable length arrays.
|
* grub-core/efiemu/prepare.c: Remove variable length arrays.
|
||||||
|
|
|
@ -1040,8 +1040,12 @@ grub_netbsd_add_boot_disk_and_wedge (void)
|
||||||
grub_uint64_t raw[GRUB_DISK_SECTOR_SIZE / 8];
|
grub_uint64_t raw[GRUB_DISK_SECTOR_SIZE / 8];
|
||||||
struct grub_partition_bsd_disk_label label;
|
struct grub_partition_bsd_disk_label label;
|
||||||
} buf;
|
} buf;
|
||||||
grub_uint8_t *hash;
|
|
||||||
GRUB_PROPERLY_ALIGNED_ARRAY (ctx, GRUB_MD_MD5->contextsize);
|
if (GRUB_MD_MD5->mdlen > GRUB_CRYPTO_MAX_MDLEN)
|
||||||
|
{
|
||||||
|
grub_error (GRUB_ERR_BUG, "mdlen too long");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dev = grub_device_open (0);
|
dev = grub_device_open (0);
|
||||||
if (! (dev && dev->disk && dev->disk->partition))
|
if (! (dev && dev->disk && dev->disk->partition))
|
||||||
|
@ -1067,6 +1071,7 @@ grub_netbsd_add_boot_disk_and_wedge (void)
|
||||||
/* Fill bootwedge. */
|
/* Fill bootwedge. */
|
||||||
{
|
{
|
||||||
struct grub_netbsd_btinfo_bootwedge biw;
|
struct grub_netbsd_btinfo_bootwedge biw;
|
||||||
|
grub_uint8_t hash[GRUB_CRYPTO_MAX_MDLEN];
|
||||||
|
|
||||||
grub_memset (&biw, 0, sizeof (biw));
|
grub_memset (&biw, 0, sizeof (biw));
|
||||||
biw.biosdev = biosdev;
|
biw.biosdev = biosdev;
|
||||||
|
@ -1075,10 +1080,8 @@ grub_netbsd_add_boot_disk_and_wedge (void)
|
||||||
biw.matchblk = partmapsector;
|
biw.matchblk = partmapsector;
|
||||||
biw.matchnblks = 1;
|
biw.matchnblks = 1;
|
||||||
|
|
||||||
GRUB_MD_MD5->init (&ctx);
|
grub_crypto_hash (GRUB_MD_MD5, hash,
|
||||||
GRUB_MD_MD5->write (&ctx, buf.raw, GRUB_DISK_SECTOR_SIZE);
|
buf.raw, GRUB_DISK_SECTOR_SIZE);
|
||||||
GRUB_MD_MD5->final (&ctx);
|
|
||||||
hash = GRUB_MD_MD5->read (&ctx);
|
|
||||||
memcpy (biw.matchhash, hash, 16);
|
memcpy (biw.matchhash, hash, 16);
|
||||||
|
|
||||||
grub_bsd_add_meta (NETBSD_BTINFO_BOOTWEDGE, &biw, sizeof (biw));
|
grub_bsd_add_meta (NETBSD_BTINFO_BOOTWEDGE, &biw, sizeof (biw));
|
||||||
|
|
Loading…
Reference in a new issue