From dc5f4a3cc2f7f02e1ff4ec2f67eda4fb73e7d89c Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 8 Apr 2019 19:31:25 +0200 Subject: vim-patch:8.0.1420: accessing freed memory in vimgrep Problem: Accessing freed memory in vimgrep. Solution: Check that the quickfix list is still valid. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/3c09722600e3218905b5d4a7b635a9e6560f87b3 --- src/nvim/testdir/test_quickfix.vim | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 896444aaaf..0f88f41678 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -2961,3 +2961,43 @@ func Test_qf_tick() call Xqftick_tests('c') call Xqftick_tests('l') endfunc + +" The following test used to crash vim +func Test_lbuffer_crash() + sv Xtest + augroup QF_Test + au! + au * * bw + augroup END + lbuffer + augroup QF_Test + au! + augroup END +endfunc + +" The following test used to crash vim +func Test_lexpr_crash() + augroup QF_Test + au! + au * * call setloclist(0, [], 'f') + augroup END + lexpr "" + augroup QF_Test + au! + augroup END + enew | only +endfunc + +" The following test used to crash Vim +func Test_lvimgrep_crash() + sv Xtest + augroup QF_Test + au! + au * * call setloclist(0, [], 'f') + augroup END + lvimgrep quickfix test_quickfix.vim + augroup QF_Test + au! + augroup END + enew | only +endfunc -- cgit