mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
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:

committed by
Justin M. Keyes

parent
06d9cc734b
commit
43a8242cd5
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user