add one more check into savedefault.

This commit is contained in:
okuji 2001-02-03 04:21:21 +00:00
parent dc1c0a6ccf
commit 13aaba9380
2 changed files with 9 additions and 2 deletions

View file

@ -1,7 +1,13 @@
2001-02-03 OKUJI Yoshinori <okuji@gnu.org>
* stage2/builtins.c (savedefault_func)
[!SUPPORT_DISKLESS && !GRUB_UTIL]: Check if the version
contained in the buffer matches to current one as well.
2001-02-02 OKUJI Yoshinori <okuji@gnu.org>
* stage2/builtins.c (savedefault_func)
[!SUPPORT_DISKLESS && !GRUB_UTIL]: Check if the stage2 is
[!SUPPORT_DISKLESS && !GRUB_UTIL]: Check if the stage2 id is
STAGE2_ID_STAGE2. Suggested by Jochen Hoenicke.
* stage2/stage2.c (cmain): If DEFAULT_ENTRY is out of entries,

View file

@ -3081,7 +3081,8 @@ savedefault_func (char *arg, int flags)
}
/* Sanity check. */
if (buffer[STAGE2_STAGE2_ID] != STAGE2_ID_STAGE2)
if (buffer[STAGE2_STAGE2_ID] != STAGE2_ID_STAGE2
|| *((short *) (buffer + STAGE2_VER_MAJ_OFFS)) != COMPAT_VERSION)
{
errnum = ERR_BAD_VERSION;
return 1;