summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_ex_mode.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-05 12:06:24 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-05 12:06:24 +0000
commite031fe90cf2e375ce861ff5e5e281e4ad229ebb9 (patch)
tree8723b11cb324f35a8959b759ad94c106e3f62dad /src/testdir/test_ex_mode.vim
parentc7269f862748c3b0f56b5a651019e18c7d5190ee (diff)
patch 8.2.3741: using freed memory in open commandv8.2.3741
Problem: Using freed memory in open command. Solution: Make a copy of the current line.
Diffstat (limited to 'src/testdir/test_ex_mode.vim')
-rw-r--r--src/testdir/test_ex_mode.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_ex_mode.vim b/src/testdir/test_ex_mode.vim
index 1ca5062328..7031115fcb 100644
--- a/src/testdir/test_ex_mode.vim
+++ b/src/testdir/test_ex_mode.vim
@@ -121,6 +121,19 @@ func Test_open_command()
close!
endfunc
+func Test_open_command_flush_line()
+ " this was accessing freed memory: the regexp match uses a pointer to the
+ " current line which becomes invalid when searching for the ') mark.
+ new
+ call setline(1, ['one', 'two. three'])
+ s/one/ONE
+ try
+ open /\%')/
+ catch /E479/
+ endtry
+ bwipe!
+endfunc
+
" Test for :g/pat/visual to run vi commands in Ex mode
" This used to hang Vim before 8.2.0274.
func Test_Ex_global()