diff --git a/ChangeLog b/ChangeLog index c0ceb3f46..922f6ead4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ +2001-02-03 OKUJI Yoshinori + + * 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 * 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, diff --git a/stage2/builtins.c b/stage2/builtins.c index e7f0fbebb..6b206c8e8 100644 --- a/stage2/builtins.c +++ b/stage2/builtins.c @@ -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;