diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c index cc849d9c94..d89a348ee2 100644 --- a/grub-core/osdep/linux/ofpath.c +++ b/grub-core/osdep/linux/ofpath.c @@ -292,6 +292,8 @@ __of_path_common(char *sysfs_path, int part; sscanf(digit_string, "%d", &part); + if (part < 1) + return NULL; snprintf(disk, sizeof (disk), "/disk@%d:%c", devno, 'a' + (part - 1)); } strcat(of_path, disk);