vim-patch:8.1.1458: crash when using gtags #10704

Problem:    Crash when using gtags. (issue vim/vim#4102)
Solution:   Check for negative row or col in screen_puts_len(). (Christian
            Brabandt)
0b4c9eddb5
This commit is contained in:
Jan Edmund Lazo 2019-08-09 18:21:52 -04:00 committed by Justin M. Keyes
parent 06d9cc734b
commit 43a8242cd5
1 changed files with 5 additions and 2 deletions

View File

@ -5372,8 +5372,11 @@ void grid_puts_len(ScreenGrid *grid, char_u *text, int textlen, int row,
screen_adjust_grid(&grid, &row, &col);
// safety check
if (grid->chars == NULL || row >= grid->Rows || col >= grid->Columns) {
// Safety check. The check for negative row and column is to fix issue
// vim/vim#4102. TODO: find out why row/col could be negative.
if (grid->chars == NULL
|| row >= grid->Rows || row < 0
|| col >= grid->Columns || col < 0) {
return;
}