diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-02-25 21:37:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-02-25 21:37:57 +0100 |
commit | a12e40351d1357687e8b5dc3122fffef705bdc08 (patch) | |
tree | b4d27ae401a3a6e7458eb95f9a6574959c679503 /src/testdir/test_options.vim | |
parent | c43a8b8de0676caf8a460b6af1310d7aba8221bb (diff) | |
download | vim-git-a12e40351d1357687e8b5dc3122fffef705bdc08.tar.gz |
patch 8.0.0370: invalid memory access when setting wildchar emptyv8.0.0370
Problem: Invalid memory access when setting wildchar empty.
Solution: Avoid going over the end of the option value. (Dominique Pelle,
closes #1509) Make option test check all number options with
empty value.
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r-- | src/testdir/test_options.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 623e46c6f..ac43c1a81 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -29,6 +29,19 @@ function! Test_isfname() set isfname& endfunction +function Test_wildchar() + " Empty 'wildchar' used to access invalid memory. + call assert_fails('set wildchar=', 'E521:') + call assert_fails('set wildchar=abc', 'E521:') + set wildchar=<Esc> + let a=execute('set wildchar?') + call assert_equal("\n wildchar=<Esc>", a) + set wildchar=27 + let a=execute('set wildchar?') + call assert_equal("\n wildchar=<Esc>", a) + set wildchar& +endfunction + function Test_options() let caught = 'ok' try |