summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-01-16 11:42:20 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-16 11:42:20 +0000
commitfa1a45705995f16ee7e69434c772107a3ddeeebd (patch)
treefa93a05ef9444dbe307d4e96aca39167ec86ecf6
parentb5988e365646746029e13473251e5844440d819c (diff)
patch 8.2.4106: going over the end of the w_lines arrayv8.2.4106
Problem: Going over the end of the w_lines array. Solution: Break out of the loop when "idx" is too big. (issue #9540)
-rw-r--r--src/drawscreen.c5
-rw-r--r--src/version.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c
index 453ca91c33..e0fb122995 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -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.
diff --git a/src/version.c b/src/version.c
index 8ddd419db1..2e8e9f3cc1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4106,
+/**/
4105,
/**/
4104,