mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 01:29:27 +00:00
improve the robustness of savedefault and default.
This commit is contained in:
1 parent
00865a8027
commit
dc1c0a6ccf
3 files changed
+22
-1
No files matched your search
+8
-1
@@ -3080,7 +3080,14 @@ savedefault_func (char *arg, int flags)
|
||||
return 1;
|
||||
}
|
||||
|
||||
entryno_ptr = (int *) ((char *) buffer + STAGE2_SAVED_ENTRYNO);
|
||||
/* Sanity check. */
|
||||
if (buffer[STAGE2_STAGE2_ID] != STAGE2_ID_STAGE2)
|
||||
{
|
||||
errnum = ERR_BAD_VERSION;
|
||||
return 1;
|
||||
}
|
||||
|
||||
entryno_ptr = (int *) (buffer + STAGE2_SAVED_ENTRYNO);
|
||||
|
||||
/* Check if the saved entry number differs from current entry number. */
|
||||
if (*entryno_ptr != current_entryno)
|
||||
|
||||
Reference in new issue
Block a user