]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-20 Dan Merillat <debian@dan.merillat.org>
authorColin Watson <cjwatson@ubuntu.com>
Wed, 20 Jan 2010 02:11:07 +0000 (02:11 +0000)
committerColin Watson <cjwatson@ubuntu.com>
Wed, 20 Jan 2010 02:11:07 +0000 (02:11 +0000)
* 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.

ChangeLog
kern/device.c
util/grub-probe.c

index 3b31a527f07cd2aaaec9d03e0f78ede9b40883bb..08c2851d512429c40e61767a01b4fc48adf61165 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
+
 2009-12-20  Robert Millan  <rmh.grub@aybabtu.com>
 
        * loader/mips/linux.c (grub_cmd_initrd)
index f519c63b20c8787d04ea6e03967e44fd3fe2a1ab..7d3577051ba016211efe67cb81dc20cceb880501 100644 (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)
        {
index 8790985424c13d4edc91628a55131de2c26e501e..ba2fe4c355014a8b541273699a6edaf38e356736 100644 (file)
@@ -94,6 +94,11 @@ probe_partmap (grub_disk_t disk)
 static int
 probe_raid_level (grub_disk_t disk)
 {
+  /* disk might be NULL in the case of a LVM physical volume with no LVM
+     signature.  Ignore such cases here.  */
+  if (!disk)
+    return -1;
+
   if (disk->dev->id != GRUB_DISK_DEVICE_RAID_ID)
     return -1;