1
0
forked from aniani/vim

patch 8.2.4979: accessing freed memory when line is flushed

Problem:    Accessing freed memory when line is flushed.
Solution:   Make a copy of the pattern to search for.
This commit is contained in:
Bram Moolenaar
2022-05-18 16:29:08 +01:00
parent 360da40b47
commit 28d032cc68
3 changed files with 18 additions and 0 deletions

View File

@@ -1392,6 +1392,15 @@ func Test_macro_search()
close!
endfunc
func Test_define_search()
" this was accessing freed memory
new
call setline(1, ['first line', '', '#define something 0'])
sil norm o0
sil! norm 
bwipe!
endfunc
" Test for [*, [/, ]* and ]/
func Test_comment_search()
new