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

View file

@ -312,6 +312,9 @@ SETUP (const char *dir,
char **cur; char **cur;
int found = 0; 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++) for (cur = root_devices; *cur; cur++)
{ {
char *drive; char *drive;