diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-08-09 18:21:52 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-08-10 00:21:52 +0200 |
commit | 43a8242cd538ebdb838007dc3d303a37e2bc9944 (patch) | |
tree | b16d8fe9d22dc2cba525bddce1f826f73fbdcee5 | |
parent | 06d9cc734bf0397b365d5d75b1766a4fb245d2f5 (diff) | |
download | rneovim-43a8242cd538ebdb838007dc3d303a37e2bc9944.tar.gz rneovim-43a8242cd538ebdb838007dc3d303a37e2bc9944.tar.bz2 rneovim-43a8242cd538ebdb838007dc3d303a37e2bc9944.zip |
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)
https://github.com/vim/vim/commit/0b4c9eddb5752d46b65d16e42230b1228f230f40
-rw-r--r-- | src/nvim/screen.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index fb019a4d2d..e2dee154df 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -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; } |