diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-28 22:21:01 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-28 22:21:01 +0100 |
commit | 7a99da43d14671cc91a302bcfa34d37a35eaa28d (patch) | |
tree | 25a20f2b4e5d3076f499ad0fbd8a6564c1384916 | |
parent | 33a5dd8b237738c15cae87441d731ab899b4e846 (diff) | |
download | vim-git-7a99da43d14671cc91a302bcfa34d37a35eaa28d.tar.gz |
patch 9.0.0309: invalid memory access when cmdheight is zerov9.0.0309
Problem: Invalid memory access when cmdheight is zero.
Solution: Check index in w_lines is smaller than Rows.
-rw-r--r-- | src/drawscreen.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c index de091e81d..aa5b8f7eb 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -830,6 +830,9 @@ after_updating_screen(int may_resize_shell UNUSED) // handle the drop now. handle_any_postponed_drop(); #endif + + // in case it was changed in dont_use_message_window() + cmdline_row = Rows - p_ch; } /* @@ -2426,7 +2429,8 @@ win_update(win_T *wp) if (wp->w_lines_valid > wp->w_height) wp->w_lines_valid = wp->w_height; for (i = wp->w_lines_valid; i - j >= idx; --i) - wp->w_lines[i] = wp->w_lines[i - j]; + if (i < Rows) + wp->w_lines[i] = wp->w_lines[i - j]; // The w_lines[] entries for inserted lines are // now invalid, but wl_size may be used above. diff --git a/src/version.c b/src/version.c index eb05f9a0c..c69e46c49 100644 --- a/src/version.c +++ b/src/version.c @@ -708,6 +708,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 309, +/**/ 308, /**/ 307, |