changeset 15109:b91cd042c2fc v8.1.0565

patch 8.1.0565: asan complains about reading before allocated block commit https://github.com/vim/vim/commit/10600db772a6b50093b8027509d7089c209d1e26 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 5 19:46:07 2018 +0100 patch 8.1.0565: asan complains about reading before allocated block Problem: Asan complains about reading before allocated block. Solution: Workaround: Avoid offset from becoming negative.
author Bram Moolenaar <Bram@vim.org>
date Wed, 05 Dec 2018 20:00:07 +0100
parents 5b52bc3a0279
children 004ab96707d4
files src/gui.c src/version.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui.c
+++ b/src/gui.c
@@ -2753,7 +2753,8 @@ gui_redraw_block(
 	}
 	else if (enc_utf8)
 	{
-	    if (ScreenLines[off + col1] == 0)
+	    // FIXME: how can the first character ever be zero?
+	    if (col1 > 0 && ScreenLines[off + col1] == 0)
 		--col1;
 # ifdef FEAT_GUI_GTK
 	    if (col2 + 1 < Columns && ScreenLines[off + col2 + 1] == 0)
--- a/src/version.c
+++ b/src/version.c
@@ -793,6 +793,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    565,
+/**/
     564,
 /**/
     563,