From 190a011a8b15506f0403ba77a587fa63fe7c7e2a Mon Sep 17 00:00:00 2001 From: Jeroen Dekkers Date: Sat, 25 Dec 2010 22:32:54 +0100 Subject: [PATCH] * grub-core/disk/raid.c (insert_array): Don't add spurious members. --- ChangeLog | 4 ++++ grub-core/disk/raid.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a20e6346..249ec6bc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-12-25 Jeroen Dekkers + + * grub-core/disk/raid.c (insert_array): Don't add spurious members. + 2010-12-25 Shea Levy * grub-core/genmod.sh.in: Use @OBJCOPY@ rather than objcopy. diff --git a/grub-core/disk/raid.c b/grub-core/disk/raid.c index f1b67a859..edc2b195d 100644 --- a/grub-core/disk/raid.c +++ b/grub-core/disk/raid.c @@ -522,14 +522,16 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array, /* We found more members of the array than the array actually has according to its superblock. This shouldn't happen normally. */ - grub_dprintf ("raid", "array->nr_devs > array->total_devs (%d)?!?", - array->total_devs); + return grub_error (GRUB_ERR_BAD_DEVICE, + "superfluous RAID member (%d found)", + array->total_devs); if (array->members[new_array->index].device != NULL) /* We found multiple devices with the same number. Again, this shouldn't happen. */ - grub_dprintf ("raid", "Found two disks with the number %d?!?", - new_array->number); + return grub_error (GRUB_ERR_BAD_DEVICE, + "found two disks with the number %d", + new_array->number); if (new_array->disk_size < array->disk_size) array->disk_size = new_array->disk_size;