diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-22 16:35:45 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-22 16:35:45 +0100 |
commit | adce965162dd89bf29ee0e5baf53652e7515762c (patch) | |
tree | 42b5a805c2e14bfb973e96104ae19af41dbeaac9 /src/testdir | |
parent | 471c0fa3eed4f6207d1cb7636970547bfd2eee26 (diff) | |
download | vim-git-adce965162dd89bf29ee0e5baf53652e7515762c.tar.gz |
patch 9.0.0246: using freed memory when 'tagfunc' deletes the bufferv9.0.0246
Problem: Using freed memory when 'tagfunc' deletes the buffer.
Solution: Make a copy of the tag name.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_tagfunc.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_tagfunc.vim b/src/testdir/test_tagfunc.vim index 05d8473cf..95826121c 100644 --- a/src/testdir/test_tagfunc.vim +++ b/src/testdir/test_tagfunc.vim @@ -389,4 +389,16 @@ func Test_tagfunc_callback() %bw! endfunc +func Test_tagfunc_wipes_buffer() + func g:Tag0unc0(t,f,o) + bwipe + endfunc + set tagfunc=g:Tag0unc0 + new + cal assert_fails('tag 0', 'E987:') + + delfunc g:Tag0unc0 + set tagfunc= +endfunc + " vim: shiftwidth=2 sts=2 expandtab |