comparison src/testdir/test_cmdline.vim @ 28741:b44f15083faf v8.2.4895

patch 8.2.4895: buffer overflow with invalid command with composing chars Commit: https://github.com/vim/vim/commit/d88934406c5375d88f8f1b65331c9f0cab68cc6c Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 6 20:38:47 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Fri, 06 May 2022 21:45:02 +0200
parents 80085afc2f4d
children 4a9fdf708575
comparison
equal deleted inserted replaced
28740:da9f84bdc1c8 28741:b44f15083faf
3351 bw! 3351 bw!
3352 call delete('Xa1b2c3.vim') 3352 call delete('Xa1b2c3.vim')
3353 set wildmenu& 3353 set wildmenu&
3354 endfunc 3354 endfunc
3355 3355
3356 " this was going over the end of IObuff
3357 func Test_report_error_with_composing()
3358 let caught = 'no'
3359 try
3360 exe repeat('0', 987) .. "0\xdd\x80\xdd\x80\xdd\x80\xdd\x80"
3361 catch /E492:/
3362 let caught = 'yes'
3363 endtry
3364 call assert_equal('yes', caught)
3365 endfunc
3366
3356 " Test for expanding 2-letter and 3-letter :substitute command arguments. 3367 " Test for expanding 2-letter and 3-letter :substitute command arguments.
3357 " These commands don't accept an argument. 3368 " These commands don't accept an argument.
3358 func Test_cmdline_complete_substitute_short() 3369 func Test_cmdline_complete_substitute_short()
3359 for cmd in ['sc', 'sce', 'scg', 'sci', 'scI', 'scn', 'scp', 'scl', 3370 for cmd in ['sc', 'sce', 'scg', 'sci', 'scI', 'scn', 'scp', 'scl',
3360 \ 'sgc', 'sge', 'sg', 'sgi', 'sgI', 'sgn', 'sgp', 'sgl', 'sgr', 3371 \ 'sgc', 'sge', 'sg', 'sgi', 'sgI', 'sgn', 'sgp', 'sgl', 'sgr',