vim-patch:7.4.1647

Problem:    Using freed memory after setqflist() and ":caddbuffer".  (Dominique)
Solution:   Set qf_ptr when adding the first item to the quickfix list.

8b20179c65
This commit is contained in:
James McCoy
2016-11-12 14:18:29 -05:00
parent c0fd830be4
commit caa33aaaf8
3 changed files with 22 additions and 2 deletions

View File

@@ -443,6 +443,17 @@ describe('helpgrep', function()
augroup! testgroup
endfunc
func Test_caddbuffer_to_empty()
helpgr quickfix
call setqflist([], 'r')
cad
call assert_fails('cn', 'E553:')
" Upstream calls quit! here to verify vim is still
" running, but that will be covered by the
" expected_empty() call in the busted test
" quit!
endfunc
]])
end)
@@ -522,6 +533,11 @@ describe('helpgrep', function()
call('XquickfixChangedByAutocmd', 'l')
expected_empty()
end)
it('does not crash after using caddbuffer with an empty qf list', function()
call('Test_caddbuffer_to_empty')
expected_empty()
end)
end)
describe('errorformat', function()