mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Problem: Illegal memory access when 'complete' ends in a backslash. Solution: Check for trailing backslash. (Dominique Pelle, closes #1478)
This commit is contained in:
@@ -7017,7 +7017,7 @@ did_set_string_option(
|
|||||||
/* skip optional filename after 'k' and 's' */
|
/* skip optional filename after 'k' and 's' */
|
||||||
while (*s && *s != ',' && *s != ' ')
|
while (*s && *s != ',' && *s != ' ')
|
||||||
{
|
{
|
||||||
if (*s == '\\')
|
if (*s == '\\' && s[1] != NUL)
|
||||||
++s;
|
++s;
|
||||||
++s;
|
++s;
|
||||||
}
|
}
|
||||||
|
@@ -136,6 +136,15 @@ func Test_thesaurus()
|
|||||||
call Check_dir_option('thesaurus')
|
call Check_dir_option('thesaurus')
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
func Test_set_completion()
|
func Test_set_completion()
|
||||||
call feedkeys(":set di\<C-A>\<C-B>\"\<CR>", 'tx')
|
call feedkeys(":set di\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
call assert_equal('"set dictionary diff diffexpr diffopt digraph directory display', @:)
|
call assert_equal('"set dictionary diff diffexpr diffopt digraph directory display', @:)
|
||||||
|
@@ -764,6 +764,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 */
|
||||||
|
/**/
|
||||||
|
333,
|
||||||
/**/
|
/**/
|
||||||
332,
|
332,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user