]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub/main.c (main): Make sure the boot drive number doesn't
authorproski <proski@localhost>
Fri, 5 May 2006 21:43:46 +0000 (21:43 +0000)
committerproski <proski@localhost>
Fri, 5 May 2006 21:43:46 +0000 (21:43 +0000)
exceed 255.

ChangeLog
grub/main.c

index fca765cd57307a9b7b35cf5eaf68b55646c679f6..9d29366636019fadd128a1e6039eeabd553c3cdf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-02  Pavel Roskin  <proski@gnu.org>
+
+       * grub/main.c (main): Make sure the boot drive number doesn't
+       exceed 255.
+
 2006-05-02  Vesa Jaaskelainen  <chaac@nic.fi>
 
        * stage2/shared.h (vbe_mode): Back ported aligment fix from GRUB 2
index dfe847e98a13d74d0af208a768608c16c89a7089..56042da5b770e622ed2148bcfb2e97b56137c562 100644 (file)
@@ -32,6 +32,7 @@ int grub_stage2 (void);
 #define WITHOUT_LIBC_STUBS 1
 #include <shared.h>
 #include <term.h>
+#include <device.h>
 
 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: