diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-06-25 19:54:09 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-06-25 19:54:09 +0100 |
commit | e178af5a586ea023622d460779fdcabbbfac0908 (patch) | |
tree | f6c400ef74882eceb6aa2dea0f67e61b8e917c3d | |
parent | e1dc76fbf333243ecfdfc3c0a81ea9984913b4f5 (diff) | |
download | vim-git-e178af5a586ea023622d460779fdcabbbfac0908.tar.gz |
patch 8.2.5160: accessing invalid memory after changing terminal sizev8.2.5160
Problem: Accessing invalid memory after changing terminal size.
Solution: Adjust cmdline_row and msg_row to the value of Rows.
-rw-r--r-- | src/term.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/term.c b/src/term.c index c1440d850..b36583114 100644 --- a/src/term.c +++ b/src/term.c @@ -3366,6 +3366,12 @@ check_shellsize(void) if (Rows < min_rows()) // need room for one window and command line Rows = min_rows(); limit_screen_size(); + + // make sure these values are not invalid + if (cmdline_row >= Rows) + cmdline_row = Rows - 1; + if (msg_row >= Rows) + msg_row = Rows - 1; } /* diff --git a/src/version.c b/src/version.c index e0a9768de..acf84d1d2 100644 --- a/src/version.c +++ b/src/version.c @@ -736,6 +736,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 5160, +/**/ 5159, /**/ 5158, |