From 4c1afd1e83cee67bf447c64f9042331f0ee5d103 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 2 Feb 2018 01:34:10 +0100 Subject: vim-patch:8.0.0337: invalid memory access in :recover command Problem: Invalid memory access in :recover command. Solution: Avoid access before directory name. (Dominique Pelle, closes vim/vim#1488) https://github.com/vim/vim/commit/c525e3a1c20f6b5d9809c8b84f80090a8e416c92 --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_alot.vim | 1 + src/nvim/testdir/test_recover.vim | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 src/nvim/testdir/test_recover.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 1b927076d8..5e5671787e 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -85,6 +85,7 @@ NEW_TESTS ?= \ test_options.res \ test_profile.res \ test_quickfix.res \ + test_recover.res \ test_retab.res \ test_scrollbind.res \ test_search.res \ diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 6df5aae677..91da0d9566 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -25,6 +25,7 @@ source test_mapping.vim source test_messages.vim source test_partial.vim source test_popup.vim +source test_recover.vim source test_regexp_utf8.vim source test_source_utf8.vim source test_statusline.vim diff --git a/src/nvim/testdir/test_recover.vim b/src/nvim/testdir/test_recover.vim new file mode 100644 index 0000000000..aa291b1294 --- /dev/null +++ b/src/nvim/testdir/test_recover.vim @@ -0,0 +1,14 @@ +" Test :recover + +func Test_recover_root_dir() + " This used to access invalid memory. + split Xtest + set dir=/ + call assert_fails('recover', 'E305:') + close! + + call assert_fails('split Xtest', 'E303:') + set dir& +endfunc + +" TODO: move recover tests from test78.in to here. -- cgit