changeset 13908:b7ca1a8db3e8 v8.0.1825

patch 8.0.1825: might use NULL pointer when out of memory commit https://github.com/vim/vim/commit/dd1d7be4e6691f447667a8217844a3b2561203be Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 12 21:34:58 2018 +0200 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.
author Christian Brabandt <cb@256bit.org>
date Sat, 12 May 2018 21:45:05 +0200
parents 40befa728594
children 3868ac2b6a21
files src/getchar.c src/version.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);
 		}
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1825,
+/**/
     1824,
 /**/
     1823,