Avoid crashing when canonicalize_file_name() fails I could reproduce this with: grub-probe /dev/sda1 Index: grub/util/getroot.c =================================================================== --- grub.orig/util/getroot.c 2012-01-30 00:29:30.754018000 -0600 +++ grub/util/getroot.c 2012-01-30 23:31:58.941211000 -0600 @@ -842,7 +931,12 @@ { char *tmp = *cur; int root, dm; - *cur = canonicalize_file_name (*cur); + *cur = canonicalize_file_name (tmp); + if (*cur == NULL) + { + grub_util_error (_("failed to get canonical path of %s"), tmp); + break; + } free (tmp); root = (strcmp (*cur, "/dev/root") == 0); dm = (strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0);