mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
fs/f2fs: Fix off-by-one error in nat journal entries check
Oops. You're allowed to have up to n = NAT_JOURNAL_ENTRIES entries
_inclusive_, because the loop below uses i < n, not i <= n. D'oh.
Fixes: 4bd9877f62 (fs/f2fs: Do not read past the end of nat journal entries)
Reported-by: программист нект <programmer11180@programist.ru>
Tested-by: программист нект <programmer11180@programist.ru>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
b58aa4e209
commit
4de39a2af6
1 file changed
+1
-1
+1
-1
@@ -650,7 +650,7 @@ get_blkaddr_from_nat_journal (struct grub_f2fs_data *data, grub_uint32_t nid,
|
||||
grub_uint16_t n = grub_le_to_cpu16 (data->nat_j.n_nats);
|
||||
grub_uint16_t i;
|
||||
|
||||
if (n >= NAT_JOURNAL_ENTRIES)
|
||||
if (n > NAT_JOURNAL_ENTRIES)
|
||||
return grub_error (GRUB_ERR_BAD_FS,
|
||||
"invalid number of nat journal entries");
|
||||
|
||||
|
||||
Reference in new issue
Block a user