2010-01-20 Dan Merillat <debian@dan.merillat.org>

* kern/device.c (grub_device_iterate): Allocate new part_ent
	structure based on sizeof (*p) rather than sizeof (p->next), to
	account for structure padding.

	* util/grub-probe.c (probe_raid_level): Return -1 immediately if
	disk is NULL, which might happen for LVM physical volumes with no
	LVM signature.
This commit is contained in:
Colin Watson 2010-01-20 02:11:07 +00:00
parent d4a4ee5765
commit 917dd37040
3 changed files with 16 additions and 1 deletions

View file

@ -138,7 +138,7 @@ grub_device_iterate (int (*hook) (const char *name))
if (! partition_name)
return 1;
p = grub_malloc (sizeof (p->next) + grub_strlen (disk->name) + 1 +
p = grub_malloc (sizeof (*p) + grub_strlen (disk->name) + 1 +
grub_strlen (partition_name) + 1);
if (!p)
{