From fa1a45705995f16ee7e69434c772107a3ddeeebd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 16 Jan 2022 11:42:20 +0000 Subject: 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) --- src/drawscreen.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/drawscreen.c') 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. -- cgit v1.2.3