Mercurial > vim
comparison src/gui.c @ 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 | 6e4e0d43b20b |
children | ae25a1172514 |
comparison
equal
deleted
inserted
replaced
15108:5b52bc3a0279 | 15109:b91cd042c2fc |
---|---|
2751 col2 += dbcs_screen_tail_off(ScreenLines + off, | 2751 col2 += dbcs_screen_tail_off(ScreenLines + off, |
2752 ScreenLines + off + col2); | 2752 ScreenLines + off + col2); |
2753 } | 2753 } |
2754 else if (enc_utf8) | 2754 else if (enc_utf8) |
2755 { | 2755 { |
2756 if (ScreenLines[off + col1] == 0) | 2756 // FIXME: how can the first character ever be zero? |
2757 if (col1 > 0 && ScreenLines[off + col1] == 0) | |
2757 --col1; | 2758 --col1; |
2758 # ifdef FEAT_GUI_GTK | 2759 # ifdef FEAT_GUI_GTK |
2759 if (col2 + 1 < Columns && ScreenLines[off + col2 + 1] == 0) | 2760 if (col2 + 1 < Columns && ScreenLines[off + col2 + 1] == 0) |
2760 ++col2; | 2761 ++col2; |
2761 # endif | 2762 # endif |