From: Bram Moolenaar Date: Wed, 5 Dec 2018 18:46:07 +0000 (+0100) Subject: patch 8.1.0565: asan complains about reading before allocated block X-Git-Tag: v8.1.0565 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10600db772a6b50093b8027509d7089c209d1e26;p=vim 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. --- diff --git a/src/gui.c b/src/gui.c index 6154b48de..b961108ed 100644 --- 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) diff --git a/src/version.c b/src/version.c index bc442425a..e4f863eaf 100644 --- a/src/version.c +++ b/src/version.c @@ -792,6 +792,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 565, /**/ 564, /**/