0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 8.1.1458: crash when using gtags

Problem:    Crash when using gtags. (issue #4102)
Solution:   Check for negative row or col in screen_puts_len(). (Christian
            Brabandt)
This commit is contained in:
Bram Moolenaar
2019-06-03 22:04:23 +02:00
parent 87abab92f5
commit 0b4c9eddb5
2 changed files with 7 additions and 1 deletions

View File

@@ -7707,7 +7707,11 @@ screen_puts_len(
int force_redraw_next = FALSE; int force_redraw_next = FALSE;
int need_redraw; 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; return;
off = LineOffset[row] + col; off = LineOffset[row] + col;

View File

@@ -767,6 +767,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1458,
/**/ /**/
1457, 1457,
/**/ /**/