]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.1.1458: crash when using gtags v8.1.1458
authorBram Moolenaar <Bram@vim.org>
Mon, 3 Jun 2019 20:04:23 +0000 (22:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 3 Jun 2019 20:04:23 +0000 (22:04 +0200)
Problem:    Crash when using gtags. (issue #4102)
Solution:   Check for negative row or col in screen_puts_len(). (Christian
            Brabandt)

src/screen.c
src/version.c

index 37999bbf6bd9edc523c835ba3d731c28b6021bbb..53343e8c84e87d85c4fde631f46b11e6c7612d35 100644 (file)
@@ -7707,7 +7707,11 @@ screen_puts_len(
     int                force_redraw_next = FALSE;
     int                need_redraw;
 
-    if (ScreenLines == NULL || row >= screen_Rows)     /* safety check */
+    // Safety check. The check for negative row and column is to fix issue
+    // #4102. TODO: find out why row/col could be negative.
+    if (ScreenLines == NULL
+           || row >= screen_Rows || row < 0
+           || col >= screen_Columns || col < 0)
        return;
     off = LineOffset[row] + col;
 
index f939ad8ca20ce6a95fdd7cd2780d48c6188f8cbc..53a2644f94a4af2c77b85007e0f6fe01f8412633 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1458,
 /**/
     1457,
 /**/