diff --git a/ChangeLog b/ChangeLog index 8563c418f..7fbc46937 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-12 Vladimir Serbinenko + + * grub-core/fs/zfs/zfs.c (zfs_fetch_nvlist): Mark unknown member here + as GRUB_ERR_BUG. Don't malloc if no device is available. + 2012-02-12 Vladimir Serbinenko * grub-core/term/terminfo.c (grub_terminfo_output_unregister): diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index 8c1e9ae87..20f425d63 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -571,9 +571,12 @@ zfs_fetch_nvlist (struct grub_zfs_device_desc *diskdesc, char **nvlist) { grub_err_t err; - *nvlist = grub_malloc (VDEV_PHYS_SIZE); + *nvlist = 0; + if (!diskdesc->dev) - return grub_error (GRUB_ERR_BAD_FS, "member drive unknown"); + return grub_error (GRUB_ERR_BUG, "member drive unknown"); + + *nvlist = grub_malloc (VDEV_PHYS_SIZE); /* Read in the vdev name-value pair list (112K). */ err = grub_disk_read (diskdesc->dev->disk, diskdesc->vdev_phys_sector, 0,