From ebc7f69d928420f8957188aea64cd57f8ed30334 Mon Sep 17 00:00:00 2001 From: ckelsel Date: Sat, 16 Jun 2018 19:39:19 +0800 Subject: vim-patch:8.0.0530: buffer overflow when 'columns' is very big Problem: Buffer overflow when 'columns' is very big. (Nikolai Pavlov) Solution: Correctly compute where to truncate. Fix translation. (closes vim/vim#1600) https://github.com/vim/vim/commit/658a3a2caf5852d071b6b1be92d9d6614a6208dc --- src/nvim/testdir/test_edit.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim index 8f815478c2..ae0404ea6c 100644 --- a/src/nvim/testdir/test_edit.vim +++ b/src/nvim/testdir/test_edit.vim @@ -1323,3 +1323,23 @@ func Test_edit_quit() only endfunc +func Test_edit_complete_very_long_name() + let save_columns = &columns + set columns=5000 + call assert_equal(5000, &columns) + set noswapfile + let dirname = getcwd() . "/Xdir" + let longdirname = dirname . repeat('/' . repeat('d', 255), 4) + let longfilename = longdirname . '/' . repeat('a', 255) + call mkdir(longdirname, 'p') + call writefile(['Totum', 'Table'], longfilename) + new + exe "next Xfile " . longfilename + exe "normal iT\" + + bwipe! + exe 'bwipe! ' . longfilename + call delete(dirname, 'rf') + let &columns = save_columns + set swapfile& +endfunc -- cgit