0
0
mirror of https://github.com/vim/vim.git synced 2025-09-06 21:53:38 -04:00

patch 8.2.4106: going over the end of the w_lines array

Problem:    Going over the end of the w_lines array.
Solution:   Break out of the loop when "idx" is too big. (issue #9540)
This commit is contained in:
Bram Moolenaar 2022-01-16 11:42:20 +00:00
parent b5988e3656
commit fa1a457059
2 changed files with 7 additions and 0 deletions

View File

@ -2539,6 +2539,11 @@ win_update(win_T *wp)
eof = TRUE;
break;
}
// Safety check: if any of the wl_size values is wrong we might go over
// the end of w_lines[].
if (idx >= Rows)
break;
}
// End of loop over all window lines.

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4106,
/**/
4105,
/**/