diff options
| author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-22 16:18:51 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-22 19:34:58 -0400 |
| commit | 563957e3cb778305230a2b1f9d5d64a682b60b7a (patch) | |
| tree | 92012f0585eabb35b6a838bd492118c122e04a37 /src/nvim/testdir/test_cd.vim | |
| parent | 13d29cb9ed0d6fba734dc5a96ed543326ee14b3f (diff) | |
| download | rneovim-563957e3cb778305230a2b1f9d5d64a682b60b7a.tar.gz rneovim-563957e3cb778305230a2b1f9d5d64a682b60b7a.tar.bz2 rneovim-563957e3cb778305230a2b1f9d5d64a682b60b7a.zip | |
vim-patch:8.0.0493: crash with cd command with very long argument
Problem: Crash with cd command with very long argument.
Solution: Check for running out of space. (Dominique Pellé, closes vim/vim#1576)
https://github.com/vim/vim/commit/15618fa643867cf0d9c31f327022a22dff78a0cf
Diffstat (limited to 'src/nvim/testdir/test_cd.vim')
| -rw-r--r-- | src/nvim/testdir/test_cd.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cd.vim b/src/nvim/testdir/test_cd.vim new file mode 100644 index 0000000000..e573419bd0 --- /dev/null +++ b/src/nvim/testdir/test_cd.vim @@ -0,0 +1,13 @@ +" Test for :cd + +func Test_cd_large_path() + " This used to crash with a heap write overflow. + call assert_fails('cd ' . repeat('x', 5000), 'E472:') +endfunc + +func Test_cd_up_and_down() + let path = getcwd() + cd .. + exe 'cd ' . path + call assert_equal(path, getcwd()) +endfunc |