From 563957e3cb778305230a2b1f9d5d64a682b60b7a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 22 Jul 2018 16:18:51 -0400 Subject: vim-patch:8.0.0493: crash with cd command with very long argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/nvim/testdir/test_cd.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/nvim/testdir/test_cd.vim (limited to 'src/nvim/testdir/test_cd.vim') 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 -- cgit