]> granicus.if.org Git - vim/commitdiff
patch 8.0.1825: might use NULL pointer when out of memory v8.0.1825
authorBram Moolenaar <Bram@vim.org>
Sat, 12 May 2018 19:34:58 +0000 (21:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 12 May 2018 19:34:58 +0000 (21:34 +0200)
Problem:    Might use NULL pointer when out of memory. (Coverity)
Solution:   Handle NULL pointer better.

src/getchar.c
src/version.c

index 5b5b3edabde0bf924099d4719af7a2d03e7e1ee9..e82155f378b66eb5e7521c12db211c2c8edaf3e1 100644 (file)
@@ -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);
                }
index 12a8073262896191ed70c817d7dccb80076c1455..97432839d3da39e941a20b6c28afe02fea1c746a 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1825,
 /**/
     1824,
 /**/