summaryrefslogtreecommitdiffstats
path: root/src/drawscreen.c
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 /src/drawscreen.c
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)
Diffstat (limited to 'src/drawscreen.c')
-rw-r--r--src/drawscreen.c5
1 files changed, 5 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.