aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-09-14 19:38:33 +0800
committerGitHub <noreply@github.com>2024-09-14 19:38:33 +0800
commit325d349f9da4518447ed34b327c261bfa56fc268 (patch)
tree731ac1ad5b4e0168f13ffcfd7c235b403192ec18 /test
parentf2173b1aa2bec63aa982794ffde806090ab5b680 (diff)
downloadrneovim-325d349f9da4518447ed34b327c261bfa56fc268.tar.gz
rneovim-325d349f9da4518447ed34b327c261bfa56fc268.tar.bz2
rneovim-325d349f9da4518447ed34b327c261bfa56fc268.zip
vim-patch:9.1.0728: [security]: heap-use-after-free in garbage collection with location list user data (#30377)
Problem: heap-use-after-free in garbage collection with location list user data. Solution: Mark user data as in use when no other window is referencing the location list (zeertzjq) fixes: neovim/neovim#30371 closes: vim/vim#15683 https://github.com/vim/vim/commit/be4bd189d23854ddf1d85ad291d8f7ad3f22b7a0
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_quickfix.vim14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/old/testdir/test_quickfix.vim b/test/old/testdir/test_quickfix.vim
index 7eb2945198..524e8608f6 100644
--- a/test/old/testdir/test_quickfix.vim
+++ b/test/old/testdir/test_quickfix.vim
@@ -4071,11 +4071,23 @@ func Test_ll_window_ctx()
enew | only
endfunc
+" Similar to the problem above, but for user data.
+func Test_ll_window_user_data()
+ call setloclist(0, [#{bufnr: bufnr(), user_data: {}}])
+ lopen
+ wincmd t
+ close
+ call test_garbagecollect_now()
+ call feedkeys("\<CR>", 'tx')
+ call test_garbagecollect_now()
+ %bwipe!
+endfunc
+
" The following test used to crash vim
func Test_lfile_crash()
sp Xtest
au QuickFixCmdPre * bw
- call assert_fails('lfile', 'E40')
+ call assert_fails('lfile', 'E40:')
au! QuickFixCmdPre
endfunc