From 955f198fc546cc30a34361932d3f454a61df0efa Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 5 Feb 2017 15:10:51 +0100 Subject: patch 8.0.0307: asan detects a memory error when EXITFREE is defined 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. --- src/charset.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/charset.c') diff --git a/src/charset.c b/src/charset.c index eb8baa946..984d7653e 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1296,6 +1296,10 @@ getvcol( posptr = NULL; /* continue until the NUL */ 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; #ifdef FEAT_MBYTE if (has_mbyte) -- cgit v1.2.1