]> granicus.if.org Git - vim/commitdiff
patch 7.4.1968 v7.4.1968
authorBram Moolenaar <Bram@vim.org>
Fri, 1 Jul 2016 09:59:47 +0000 (11:59 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 1 Jul 2016 09:59:47 +0000 (11:59 +0200)
Problem:    Invalid memory access with "\<C-">.
Solution:   Do not recognize this as a special character. (Dominique Pelle)

src/misc2.c
src/testdir/test_expr.vim
src/version.c

index 1018e4b066c9e318ca80b89f3e1c4a622eb5abca..397799ad8ed96642a49ec699166e773d325b20d1 100644 (file)
@@ -2741,8 +2741,10 @@ find_special_key(
                else
 #endif
                    l = 1;
-               if (bp[l + 1] == '>')
-                   bp += l;    /* anything accepted, like <C-?> */
+               /* Anything accepted, like <C-?>, except <C-">, because the "
+                * ends the string. */
+               if (bp[l] != '"' && bp[l + 1] == '>')
+                   bp += l;
            }
        }
        if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3])
index 7d7870e5343cdee3e397234eef8fb5761868a051..f44e21660ce5c012a54217dc7e2ecb1690271767 100644 (file)
@@ -101,3 +101,8 @@ endfunc
 func Test_set_reg_null_list()
   call setreg('x', test_null_list())
 endfunc
+
+func Test_special_char()
+  " The failure is only visible using valgrind.
+  call assert_fails('echo "\<C-">')
+endfunc
index 89dd5d706233d248f5fae80714d9020de78ee8e4..2a3ded76335a88daeedde73254b24ab1b89afbff 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1968,
 /**/
     1967,
 /**/