diff --git a/ChangeLog b/ChangeLog index fca765cd5..9d2936663 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-05-02 Pavel Roskin + + * grub/main.c (main): Make sure the boot drive number doesn't + exceed 255. + 2006-05-02 Vesa Jaaskelainen * stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2 diff --git a/grub/main.c b/grub/main.c index dfe847e98..56042da5b 100644 --- a/grub/main.c +++ b/grub/main.c @@ -32,6 +32,7 @@ int grub_stage2 (void); #define WITHOUT_LIBC_STUBS 1 #include #include +#include char *program_name = 0; int use_config_file = 1; @@ -192,6 +193,12 @@ main (int argc, char **argv) perror ("strtoul"); exit (1); } + if (boot_drive >= NUM_DISKS) + { + fprintf (stderr, "boot_drive should be from 0 to %d\n", + NUM_DISKS - 1); + exit (1); + } break; case OPT_NO_CONFIG_FILE: