0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 7.4.1968

Problem:    Invalid memory access with "\<C-">.
Solution:   Do not recognize this as a special character. (Dominique Pelle)
This commit is contained in:
Bram Moolenaar
2016-07-01 11:59:47 +02:00
parent 6747fabc73
commit 1d90a5a5af
3 changed files with 11 additions and 2 deletions

View File

@@ -2741,8 +2741,10 @@ find_special_key(
else else
#endif #endif
l = 1; l = 1;
if (bp[l + 1] == '>') /* Anything accepted, like <C-?>, except <C-">, because the "
bp += l; /* anything accepted, like <C-?> */ * ends the string. */
if (bp[l] != '"' && bp[l + 1] == '>')
bp += l;
} }
} }
if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3]) if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3])

View File

@@ -101,3 +101,8 @@ endfunc
func Test_set_reg_null_list() func Test_set_reg_null_list()
call setreg('x', test_null_list()) call setreg('x', test_null_list())
endfunc endfunc
func Test_special_char()
" The failure is only visible using valgrind.
call assert_fails('echo "\<C-">')
endfunc

View File

@@ -753,6 +753,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1968,
/**/ /**/
1967, 1967,
/**/ /**/