Avoid NULL deref in grub_device_open.
* grub-core/kern/device.c (grub_device_open): Don't dereference a NULL pointer upon failed grub_env_get.
This commit is contained in:
parent
f7db6f4a55
commit
8a5d6919e1
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2011-06-23 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
|
avoid NULL deref in grub_device_open
|
||||||
|
* grub-core/kern/device.c (grub_device_open): Don't dereference
|
||||||
|
a NULL pointer upon failed grub_env_get.
|
||||||
|
|
||||||
2011-06-23 Vladimir Serbinenko <phcoder@gmail.com>
|
2011-06-23 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
Support non-512B sectors and agglomerate reads.
|
Support non-512B sectors and agglomerate reads.
|
||||||
|
|
|
@ -35,7 +35,7 @@ grub_device_open (const char *name)
|
||||||
if (! name)
|
if (! name)
|
||||||
{
|
{
|
||||||
name = grub_env_get ("root");
|
name = grub_env_get ("root");
|
||||||
if (*name == '\0')
|
if (name == NULL || *name == '\0')
|
||||||
{
|
{
|
||||||
grub_error (GRUB_ERR_BAD_DEVICE, "no device is set");
|
grub_error (GRUB_ERR_BAD_DEVICE, "no device is set");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
Loading…
Reference in a new issue