diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-10-28 14:45:16 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-10-28 14:45:16 +0200 |
commit | 0e19fc07e73214f94441cb3a495504a1de21eb07 (patch) | |
tree | cadf3190da7c9975c940b9d91cafed5a39de3daf | |
parent | dc1c98129484e7879bc6dbf38e523beb730988b6 (diff) | |
download | vim-git-0e19fc07e73214f94441cb3a495504a1de21eb07.tar.gz |
patch 8.0.1228: invalid memory access in GUI testv8.0.1228
Problem: Invalid memory access in GUI test.
Solution: Check that the row is not outside of the screen.
-rw-r--r-- | src/screen.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c index c92b17ebb..05853d442 100644 --- a/src/screen.c +++ b/src/screen.c @@ -2123,7 +2123,11 @@ 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) diff --git a/src/version.c b/src/version.c index f66e29255..b49c7643c 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1228, +/**/ 1227, /**/ 1226, |