Mercurial > vim
comparison src/screen.c @ 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 | 6a99709c6ae3 |
children | 90cec755ff80 |
comparison
equal
deleted
inserted
replaced
16913:1d61668fb248 | 16914:66a94fd8e37d |
---|---|
7705 #endif | 7705 #endif |
7706 int force_redraw_this; | 7706 int force_redraw_this; |
7707 int force_redraw_next = FALSE; | 7707 int force_redraw_next = FALSE; |
7708 int need_redraw; | 7708 int need_redraw; |
7709 | 7709 |
7710 if (ScreenLines == NULL || row >= screen_Rows) /* safety check */ | 7710 // Safety check. The check for negative row and column is to fix issue |
7711 // #4102. TODO: find out why row/col could be negative. | |
7712 if (ScreenLines == NULL | |
7713 || row >= screen_Rows || row < 0 | |
7714 || col >= screen_Columns || col < 0) | |
7711 return; | 7715 return; |
7712 off = LineOffset[row] + col; | 7716 off = LineOffset[row] + col; |
7713 | 7717 |
7714 /* When drawing over the right halve of a double-wide char clear out the | 7718 /* When drawing over the right halve of a double-wide char clear out the |
7715 * left halve. Only needed in a terminal. */ | 7719 * left halve. Only needed in a terminal. */ |