diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-16 11:42:20 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-16 11:42:20 +0000 |
commit | fa1a45705995f16ee7e69434c772107a3ddeeebd (patch) | |
tree | fa93a05ef9444dbe307d4e96aca39167ec86ecf6 /src/drawscreen.c | |
parent | b5988e365646746029e13473251e5844440d819c (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.c | 5 |
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. |