From 0b4c9eddb5752d46b65d16e42230b1228f230f40 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 3 Jun 2019 22:04:23 +0200 Subject: [PATCH] patch 8.1.1458: crash when using gtags Problem: Crash when using gtags. (issue #4102) Solution: Check for negative row or col in screen_puts_len(). (Christian Brabandt) --- src/screen.c | 6 +++++- src/version.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index 37999bbf6b..53343e8c84 100644 --- 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; diff --git a/src/version.c b/src/version.c index f939ad8ca2..53a2644f94 100644 --- a/src/version.c +++ b/src/version.c @@ -767,6 +767,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1458, /**/ 1457, /**/