diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-08-17 08:58:51 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-08-17 09:07:12 +0800 |
| commit | 65bcec9e9ba8f134536b9d3db1d5beac26991e17 (patch) | |
| tree | 12a47066f8899594a4d67ff5202de8dddf4ed47b /src/nvim/testdir/test_eval_stuff.vim | |
| parent | 542fa8a9cc10abb8eddab25a19844d19b94f53c1 (diff) | |
| download | rneovim-65bcec9e9ba8f134536b9d3db1d5beac26991e17.tar.gz rneovim-65bcec9e9ba8f134536b9d3db1d5beac26991e17.tar.bz2 rneovim-65bcec9e9ba8f134536b9d3db1d5beac26991e17.zip | |
vim-patch:9.0.0220: invalid memory access with for loop over NULL string
Problem: Invalid memory access with for loop over NULL string.
Solution: Make sure mb_ptr2len() consistently returns zero for NUL.
https://github.com/vim/vim/commit/f6d39c31d2177549a986d170e192d8351bd571e2
Diffstat (limited to 'src/nvim/testdir/test_eval_stuff.vim')
| -rw-r--r-- | src/nvim/testdir/test_eval_stuff.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim index 811c6c946d..eff1376d3c 100644 --- a/src/nvim/testdir/test_eval_stuff.vim +++ b/src/nvim/testdir/test_eval_stuff.vim @@ -75,6 +75,18 @@ func Test_for_invalid() redraw endfunc +func Test_for_over_null_string() + let save_enc = &enc + " set enc=iso8859 + let cnt = 0 + for c in v:_null_string + let cnt += 1 + endfor + call assert_equal(0, cnt) + + let &enc = save_enc +endfunc + func Test_readfile_binary() new call setline(1, ['one', 'two', 'three']) |