aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-24 06:25:34 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-06-24 07:26:06 +0800
commit0cf0be302beb3029d245814eca427f4a4ebd2f67 (patch)
tree696dd4495dc7a9b5172f1549325264067c97d9df /src/nvim/testdir
parent764dc7c383235950c153a133d399523e2bbffed4 (diff)
downloadrneovim-0cf0be302beb3029d245814eca427f4a4ebd2f67.tar.gz
rneovim-0cf0be302beb3029d245814eca427f4a4ebd2f67.tar.bz2
rneovim-0cf0be302beb3029d245814eca427f4a4ebd2f67.zip
vim-patch:8.2.4895: buffer overflow with invalid command with composing chars
Problem: Buffer overflow with invalid command with composing chars. Solution: Check that the whole character fits in the buffer. https://github.com/vim/vim/commit/d88934406c5375d88f8f1b65331c9f0cab68cc6c
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cmdline.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 4630ddd6e7..887c8e1593 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -1220,6 +1220,17 @@ func Test_recalling_cmdline()
cunmap <Plug>(save-cmdline)
endfunc
+" this was going over the end of IObuff
+func Test_report_error_with_composing()
+ let caught = 'no'
+ try
+ exe repeat('0', 987) .. "0\xdd\x80\xdd\x80\xdd\x80\xdd\x80"
+ catch /E492:/
+ let caught = 'yes'
+ endtry
+ call assert_equal('yes', caught)
+endfunc
+
" Test for expanding 2-letter and 3-letter :substitute command arguments.
" These commands don't accept an argument.
func Test_cmdline_complete_substitute_short()