From 02e7b75ee870afa8ba0d37143a782666f123d6dd Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 9 May 2007 15:09:41 +0000 Subject: [PATCH] 2007-05-09 Robert Millan * util/i386/pc/grub-probe.c (probe): When detecting partition map, fail gracefuly if dev->disk->partition == NULL. --- ChangeLog | 5 +++++ util/i386/pc/grub-probe.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7b43ed085..28c8af2e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-05-09 Robert Millan + + * util/i386/pc/grub-probe.c (probe): When detecting partition map, + fail gracefuly if dev->disk->partition == NULL. + 2007-05-07 Robert Millan * util/i386/pc/grub-probe.c: Add `grub-probe -t partmap' parameter to diff --git a/util/i386/pc/grub-probe.c b/util/i386/pc/grub-probe.c index 8ee1225af..21085f229 100644 --- a/util/i386/pc/grub-probe.c +++ b/util/i386/pc/grub-probe.c @@ -126,6 +126,9 @@ probe (const char *path) if (print == PRINT_PARTMAP) { + if (dev->disk->partition == NULL) + grub_util_error ("Cannot detect partition map for %s", drive_name); + if (strcmp (dev->disk->partition->partmap->name, "amiga_partition_map") == 0) printf ("amiga\n"); else if (strcmp (dev->disk->partition->partmap->name, "apple_partition_map") == 0)