patch 7.4.1968
Problem: Invalid memory access with "\<C-">.
Solution: Do not recognize this as a special character. (Dominique Pelle)
diff --git a/src/misc2.c b/src/misc2.c
index 1018e4b..397799a 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -2741,8 +2741,10 @@
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])
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim
index 7d7870e..f44e216 100644
--- a/src/testdir/test_expr.vim
+++ b/src/testdir/test_expr.vim
@@ -101,3 +101,8 @@
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
diff --git a/src/version.c b/src/version.c
index 89dd5d7..2a3ded7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1968,
+/**/
1967,
/**/
1966,