Mercurial > vim
diff src/testdir/test_options.vim @ 10962:6da4287fd735 v8.0.0370
patch 8.0.0370: invalid memory access when setting wildchar empty
commit https://github.com/vim/vim/commit/a12e40351d1357687e8b5dc3122fffef705bdc08
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 25 21:37:57 2017 +0100
patch 8.0.0370: invalid memory access when setting wildchar empty
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 25 Feb 2017 21:45:04 +0100 |
parents | e5896de85dcf |
children | bbdb4f0134cb |
line wrap: on
line diff
--- 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