# HG changeset patch # User Bram Moolenaar # Date 1642333503 -3600 # Node ID 6d7fe3af5aa2895bab0d4418fe5561fe15377820 # Parent ebd3d5313ea65f519ec6721b16eb0a02f64f050e patch 8.2.4106: going over the end of the w_lines array Commit: https://github.com/vim/vim/commit/fa1a45705995f16ee7e69434c772107a3ddeeebd Author: Bram Moolenaar Date: Sun Jan 16 11:42:20 2022 +0000 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 https://github.com/vim/vim/issues/9540) diff --git a/src/drawscreen.c b/src/drawscreen.c --- 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 --- 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,