aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-12 16:17:36 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-12 16:23:32 +0800
commitaa373e3abb17a5265b1afa8c119207980e90001a (patch)
treeeff7937a6f68e013a131891dfd3ebeeb121c4ee1 /src/nvim/testdir
parent4aa4675fbface275224d178ebb436bc214dd1056 (diff)
downloadrneovim-aa373e3abb17a5265b1afa8c119207980e90001a.tar.gz
rneovim-aa373e3abb17a5265b1afa8c119207980e90001a.tar.bz2
rneovim-aa373e3abb17a5265b1afa8c119207980e90001a.zip
vim-patch:8.2.5050: using freed memory when searching for pattern in path
Problem: Using freed memory when searching for pattern in path. Solution: Make a copy of the line. https://github.com/vim/vim/commit/409510c588b1eec1ae33511ae97a21eb8e110895 Cherry-pick Test_def_search() -> Test_macro_search() from patch 8.2.0369
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_tagjump.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim
index bcb808e774..3fde7f3f06 100644
--- a/src/nvim/testdir/test_tagjump.vim
+++ b/src/nvim/testdir/test_tagjump.vim
@@ -1180,9 +1180,20 @@ func Test_inc_search()
close!
endfunc
+" this was using a line from ml_get() freed by the regexp
+func Test_isearch_copy_line()
+ new
+ norm o
+ norm 0
+ 0norm o
+ sil! norm bc0
+ sil! isearch \%')
+ bwipe!
+endfunc
+
" Test for :dsearch, :dlist, :djump and :dsplit commands
" Test for [d, ]d, [D, ]D, [ CTRL-D, ] CTRL-D and CTRL-W d commands
-func Test_def_search()
+func Test_macro_search()
new
call setline(1, ['#define FOO 1', '#define FOO 2', '#define FOO 3',
\ '#define FOO 4', '#define FOO 5'])