aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-02-10 19:55:59 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-02-16 07:49:44 -0500
commit5e38516a462cf346e3379f68f4581afa22a9314c (patch)
treee177f984f1dac1d1d68ff255d4a0af2d104855b3 /src
parentbde4f47eb29b757e3282fb08ae6ee844941b1f65 (diff)
downloadrneovim-5e38516a462cf346e3379f68f4581afa22a9314c.tar.gz
rneovim-5e38516a462cf346e3379f68f4581afa22a9314c.tar.bz2
rneovim-5e38516a462cf346e3379f68f4581afa22a9314c.zip
vim-patch:8.2.0241: crash when setting 'buftype' to "quickfix"
Problem: Crash when setting 'buftype' to "quickfix". Solution: Check that error list is not NULL. (closes vim/vim#5613) https://github.com/vim/vim/commit/99234f29aa8767f2e71bb1f5db6ee0131bc8e64e
Diffstat (limited to 'src')
-rw-r--r--src/nvim/quickfix.c2
-rw-r--r--src/nvim/testdir/test_quickfix.vim7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 71c6f06ac0..06ffa171ca 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -3845,7 +3845,7 @@ static void qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last)
*dirname = NUL;
// Add one line for each error
- if (old_last == NULL) {
+ if (old_last == NULL || old_last->qf_next == NULL) {
qfp = qfl->qf_start;
lnum = 0;
} else {
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index d7b387c2c9..015f771435 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -1510,6 +1510,13 @@ func Test_setqflist_invalid_nr()
call setqflist([], ' ', {'nr' : $XXX_DOES_NOT_EXIST})
endfunc
+func Test_setqflist_user_sets_buftype()
+ call setqflist([{'text': 'foo'}, {'text': 'bar'}])
+ set buftype=quickfix
+ call setqflist([], 'a')
+ enew
+endfunc
+
func Test_quickfix_set_list_with_act()
call XquickfixSetListWithAct('c')
call XquickfixSetListWithAct('l')