setup: fix NULL pointer dereference

Check return value of grub_guess_root_devices

Found by: Coverity scan.
CID: 73638, 73751
This commit is contained in:
Andrei Borzenkov 2016-01-09 21:25:22 +03:00
parent 670c43af27
commit 5a5a3c6963
1 changed files with 3 additions and 0 deletions

View File

@ -312,6 +312,9 @@ SETUP (const char *dir,
char **cur;
int found = 0;
if (!root_devices)
grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), dir);
for (cur = root_devices; *cur; cur++)
{
char *drive;