]> granicus.if.org Git - vim/commitdiff
patch 8.1.0565: asan complains about reading before allocated block v8.1.0565
authorBram Moolenaar <Bram@vim.org>
Wed, 5 Dec 2018 18:46:07 +0000 (19:46 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 5 Dec 2018 18:46:07 +0000 (19:46 +0100)
Problem:    Asan complains about reading before allocated block.
Solution:   Workaround: Avoid offset from becoming negative.

src/gui.c
src/version.c

index 6154b48deb04c9a3177e875d04600c192511fa8f..b961108ed87a4df1253eaf6c080b414d6801380a 100644 (file)
--- 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)
index bc442425ad55d0782fbd514523fbd2fc7dbcfe7d..e4f863eaf11cbecb96365bff21708f9992b6397e 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    565,
 /**/
     564,
 /**/