aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-24 20:37:55 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-24 20:41:52 -0400
commit59b53e7bc7ef1d2e92725564f0a0e56cb6034daa (patch)
tree522a602407e37e3099fe19306dd884eff64f535f
parentcba3025c438c4be0c5fa5098cabe0129c0e44e96 (diff)
downloadrneovim-59b53e7bc7ef1d2e92725564f0a0e56cb6034daa.tar.gz
rneovim-59b53e7bc7ef1d2e92725564f0a0e56cb6034daa.tar.bz2
rneovim-59b53e7bc7ef1d2e92725564f0a0e56cb6034daa.zip
vim-patch:8.0.1228: invalid memory access in GUI test
Problem: Invalid memory access in GUI test. Solution: Check that the row is not outside of the screen. https://github.com/vim/vim/commit/0e19fc07e73214f94441cb3a495504a1de21eb07
-rw-r--r--src/nvim/screen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 092820321c..36901e92ee 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -1448,7 +1448,11 @@ static void win_update(win_T *wp)
wp->w_lines[idx].wl_lnum = lnum;
wp->w_lines[idx].wl_valid = true;
- if (row > wp->w_height) { // past end of screen
+
+ // Past end of the window or end of the screen. Note that after
+ // resizing wp->w_height may be end up too big. That's a problem
+ // elsewhere, but prevent a crash here.
+ if (row > wp->w_height || row + wp->w_winrow >= Rows) {
// we may need the size of that too long line later on
if (dollar_vcol == -1) {
wp->w_lines[idx].wl_size = plines_win(wp, lnum, true);