From: Andrei Borzenkov Date: Sat, 9 Jan 2016 18:25:22 +0000 (+0300) Subject: setup: fix NULL pointer dereference X-Git-Tag: 2.02-beta3~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a5a3c69630ea117f54c07e891007fe3374581ba;p=thirdparty%2Fgrub.git setup: fix NULL pointer dereference Check return value of grub_guess_root_devices Found by: Coverity scan. CID: 73638, 73751 --- diff --git a/util/setup.c b/util/setup.c index d74567d0a..8aa5a39a7 100644 --- a/util/setup.c +++ b/util/setup.c @@ -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;