mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 19:25:11 -07:00
vim-patch:8.0.0333
Problem: Illegal memory access when 'complete' ends in a backslash.
Solution: Check for trailing backslash. (Dominique Pelle, closes vim/vim#1478)
226c534291
This commit is contained in:
parent
4bb0e95abb
commit
2b53a565b9
@ -2997,9 +2997,10 @@ did_set_string_option (
|
||||
if (s[-1] == 'k' || s[-1] == 's') {
|
||||
/* skip optional filename after 'k' and 's' */
|
||||
while (*s && *s != ',' && *s != ' ') {
|
||||
if (*s == '\\')
|
||||
++s;
|
||||
++s;
|
||||
if (*s == '\\' && s[1] != NUL) {
|
||||
s++;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
} else {
|
||||
if (errbuf != NULL) {
|
||||
|
@ -103,3 +103,13 @@ func Test_keymap_valid()
|
||||
call assert_fails(":set kmp=trunc\x00name", "E544:")
|
||||
call assert_fails(":set kmp=trunc\x00name", "trunc")
|
||||
endfunc
|
||||
|
||||
func Test_complete()
|
||||
" Trailing single backslash used to cause invalid memory access.
|
||||
set complete=s\
|
||||
new
|
||||
call feedkeys("i\<C-N>\<Esc>", 'xt')
|
||||
bwipe!
|
||||
set complete&
|
||||
endfun
|
||||
|
||||
|
@ -619,7 +619,7 @@ static const int included_patches[] = {
|
||||
// 336,
|
||||
// 335,
|
||||
// 334,
|
||||
// 333,
|
||||
333,
|
||||
// 332,
|
||||
331,
|
||||
// 330,
|
||||
|
Loading…
Reference in New Issue
Block a user