From c398402f1225e8050856260cbc6ae929ff2f5c31 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 22 Mar 2017 15:02:19 +0100 Subject: vim-patch:8.0.0307 Problem: Asan detects a memory error when EXITFREE is defined. (Dominique Pelle) Solution: In getvcol() check for ml_get_buf() returning an empty string. Also skip adjusting the scroll position. Set "exiting" in mch_exit() for all systems. https://github.com/vim/vim/commit/955f198fc546cc30a34361932d3f454a61df0efa --- src/nvim/charset.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/charset.c') diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 9e240fd38b..f31cef5886 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1160,6 +1160,11 @@ void getvcol(win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, // continue until the NUL posptr = NULL; } else { + // Special check for an empty line, which can happen on exit, when + // ml_get_buf() always returns an empty string. + if (*ptr == NUL) { + pos->col = 0; + } posptr = ptr + pos->col; } -- cgit