Skip to content

Commit

Permalink
patch 8.2.4106: going over the end of the w_lines array
Browse files Browse the repository at this point in the history
Problem:    Going over the end of the w_lines array.
Solution:   Break out of the loop when "idx" is too big. (issue #9540)
  • Loading branch information
brammool committed Jan 16, 2022
1 parent b5988e3 commit fa1a457
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/drawscreen.c
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4106,
/**/
4105,
/**/
Expand Down

0 comments on commit fa1a457

Please sign in to comment.