aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-09-22 13:11:50 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-09-22 13:13:11 +0800
commit3f4030e1712db64ee398459f2e5fcf2803d253ab (patch)
treea1e82b3e076a50983d5b8a6cdcc68a8a01e58d25
parentd76017c613647326b4195580422196a7d0fd548d (diff)
downloadrneovim-3f4030e1712db64ee398459f2e5fcf2803d253ab.tar.gz
rneovim-3f4030e1712db64ee398459f2e5fcf2803d253ab.tar.bz2
rneovim-3f4030e1712db64ee398459f2e5fcf2803d253ab.zip
vim-patch:8.2.3428: using freed memory when replacing
Problem: Using freed memory when replacing. (Dhiraj Mishra) Solution: Get the line pointer after calling ins_copychar(). https://github.com/vim/vim/commit/35a9a00afcb20897d462a766793ff45534810dc3 This patch is N/A as it only applies to non-UTF-8 encoding.
-rw-r--r--src/nvim/testdir/test_edit.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_edit.vim b/src/nvim/testdir/test_edit.vim
index 51eb89f71d..dc8e294420 100644
--- a/src/nvim/testdir/test_edit.vim
+++ b/src/nvim/testdir/test_edit.vim
@@ -1951,4 +1951,16 @@ func Test_edit_revins()
bw!
endfunc
+" Test for getting the character of the line below after "p"
+func Test_edit_put_CTRL_E()
+ " set encoding=latin1
+ new
+ let @" = ''
+ sil! norm orggRx
+ sil! norm pr
+ call assert_equal(['r', 'r'], getline(1, 2))
+ bwipe!
+ set encoding=utf-8
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab