Mercurial > vim
diff src/testdir/test_quickfix.vim @ 13066:617112037564 v8.0.1408
patch 8.0.1408: crash in setqflist()
commit https://github.com/vim/vim/commit/a0ca7d002d4efcf4bce0af6943146a339677ed3d
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 19 10:22:19 2017 +0100
patch 8.0.1408: crash in setqflist()
Problem: Crash in setqflist().
Solution: Check for string to be NULL. (Dominique Pelle, closes https://github.com/vim/vim/issues/2464)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Dec 2017 10:30:05 +0100 |
parents | 6479dadcf214 |
children | 66c014c71dad |
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -1428,6 +1428,11 @@ func XquickfixSetListWithAct(cchar) call assert_fails("call g:Xsetlist(list1, 0)", 'E928:') endfunc +func Test_setqflist_invalid_nr() + " The following command used to crash Vim + call setqflist([], ' ', {'nr' : $XXX_DOES_NOT_EXIST}) +endfunc + func Test_quickfix_set_list_with_act() call XquickfixSetListWithAct('c') call XquickfixSetListWithAct('l') @@ -2946,6 +2951,15 @@ func Test_getqflist() call Xgetlist_empty_tests('l') endfunc +func Test_getqflist_invalid_nr() + " The following commands used to crash Vim + cexpr "" + call getqflist({'nr' : $XXX_DOES_NOT_EXIST_XXX}) + + " Cleanup + call setqflist([], 'r') +endfunc + " Tests for the quickfix/location list changedtick func Xqftick_tests(cchar) call s:setup_commands(a:cchar)