From: Bram Moolenaar Date: Sat, 12 May 2018 19:34:58 +0000 (+0200) Subject: patch 8.0.1825: might use NULL pointer when out of memory X-Git-Tag: v8.0.1825 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd1d7be4e6691f447667a8217844a3b2561203be;p=thirdparty%2Fvim.git patch 8.0.1825: might use NULL pointer when out of memory Problem: Might use NULL pointer when out of memory. (Coverity) Solution: Handle NULL pointer better. --- diff --git a/src/getchar.c b/src/getchar.c index 5b5b3edabd..e82155f378 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -4523,10 +4523,12 @@ check_abbr( if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL) { + char_u *qe = vim_strsave(mp->m_keys); + /* might have CSI escaped mp->m_keys */ - q = vim_strsave(mp->m_keys); - if (q != NULL) + if (qe != NULL) { + q = qe; vim_unescape_csi(q); qlen = (int)STRLEN(q); } diff --git a/src/version.c b/src/version.c index 12a8073262..97432839d3 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1825, /**/ 1824, /**/