summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-03 22:04:23 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-03 22:04:23 +0200
commit0b4c9eddb5752d46b65d16e42230b1228f230f40 (patch)
treea9131b4908b930f24f2ac072a3ed787ad2277553
parent87abab92f5b42319a7b10df9974ed3ce5c9b2b9b (diff)
downloadvim-git-0b4c9eddb5752d46b65d16e42230b1228f230f40.tar.gz
patch 8.1.1458: crash when using gtagsv8.1.1458
Problem: Crash when using gtags. (issue #4102) Solution: Check for negative row or col in screen_puts_len(). (Christian Brabandt)
-rw-r--r--src/screen.c6
-rw-r--r--src/version.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c
index 37999bbf6..53343e8c8 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -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;
diff --git a/src/version.c b/src/version.c
index f939ad8ca..53a2644f9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1458,
+/**/
1457,
/**/
1456,