Mercurial > vim
changeset 16914:66a94fd8e37d v8.1.1458
patch 8.1.1458: crash when using gtags
commit https://github.com/vim/vim/commit/0b4c9eddb5752d46b65d16e42230b1228f230f40
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 3 22:04:23 2019 +0200
patch 8.1.1458: crash when using gtags
Problem: Crash when using gtags. (issue https://github.com/vim/vim/issues/4102)
Solution: Check for negative row or col in screen_puts_len(). (Christian
Brabandt)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 03 Jun 2019 22:15:05 +0200 |
parents | 1d61668fb248 |
children | f1cb217928e0 |
files | src/screen.c src/version.c |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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;