mirror of
https://github.com/vim/vim.git
synced 2025-10-02 05:04:20 -04:00
patch 7.4.2235
Problem: submatch() does not check for a valid argument. Solution: Give an error if the argument is out of range. (Dominique Pelle)
This commit is contained in:
@@ -198,6 +198,11 @@ func Test_substitute_expr()
|
||||
call assert_equal('--', substitute('xxx', 'x*', {-> '-' . Recurse() . '-'}, ''))
|
||||
endfunc
|
||||
|
||||
func Test_invalid_submatch()
|
||||
" This was causing invalid memory access in Vim-7.4.2232 and older
|
||||
call assert_fails("call substitute('x', '.', {-> submatch(10)}, '')", 'E935:')
|
||||
endfunc
|
||||
|
||||
func Test_substitute_expr_arg()
|
||||
call assert_equal('123456789-123456789=', substitute('123456789',
|
||||
\ '\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)',
|
||||
|
Reference in New Issue
Block a user