vim-patch:7.4.1968 (#5949)

Problem:    Invalid memory access with "\<C-">.
Solution:   Do not recognize this as a special character. (Dominique Pelle)

1d90a5a5af
This commit is contained in:
Shougo 2017-01-15 09:08:27 +09:00 committed by Justin M. Keyes
parent b98da8de98
commit c88e4a270d
3 changed files with 10 additions and 3 deletions

View File

@ -573,8 +573,10 @@ int find_special_key(const char_u **srcp, const size_t src_len, int *const modp,
} else { } else {
l = 1; l = 1;
} }
if (end - bp > l && bp[l + 1] == '>') { if (end - bp > l && bp[l] != '"' && bp[l + 1] == '>') {
bp += l; // anything accepted, like <C-?> // Anything accepted, like <C-?>, except <C-">, because the "
// ends the string.
bp += l;
} }
} }
} }

View File

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

View File

@ -472,7 +472,7 @@ static int included_patches[] = {
1971, 1971,
1970, 1970,
// 1969 NA // 1969 NA
// 1968, 1968,
1967, 1967,
1966, 1966,
// 1965 NA // 1965 NA