mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-20 22:48:22 +00:00
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:
1 parent
f7db6f4a55
commit
8a5d6919e1
2 files changed
+7
-1
No files matched your search
@@ -35,7 +35,7 @@ grub_device_open (const char *name)
|
||||
if (! name)
|
||||
{
|
||||
name = grub_env_get ("root");
|
||||
if (*name == '\0')
|
||||
if (name == NULL || *name == '\0')
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_DEVICE, "no device is set");
|
||||
goto fail;
|
||||
|
||||
Reference in new issue
Block a user