]> granicus.if.org Git - vim/commitdiff
patch 8.0.1228: invalid memory access in GUI test v8.0.1228
authorBram Moolenaar <Bram@vim.org>
Sat, 28 Oct 2017 12:45:16 +0000 (14:45 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 28 Oct 2017 12:45:16 +0000 (14:45 +0200)
Problem:    Invalid memory access in GUI test.
Solution:   Check that the row is not outside of the screen.

src/screen.c
src/version.c

index c92b17ebb5c08e9d50dda61855a41bd878bac0b5..05853d442eeb9241e6b4ab7f85b4c01995a0e739 100644 (file)
@@ -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)
index f66e29255de276adc6e002d24be1ac3bb6f92581..b49c7643cf51a742034fd369f1817989ea616236 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1228,
 /**/
     1227,
 /**/