forked from aniani/vim
patch 8.0.0575: using freed memory when resetting 'indentexpr'
Problem: Using freed memory when resetting 'indentexpr' while evaluating
it. (Dominique Pelle)
Solution: Make a copy of 'indentexpr'.
This commit is contained in:
@@ -319,3 +319,16 @@ func Test_set_values()
|
||||
throw 'Skipped: opt_test.vim does not exist'
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func ResetIndentexpr()
|
||||
set indentexpr=
|
||||
endfunc
|
||||
|
||||
func Test_set_indentexpr()
|
||||
" this was causing usage of freed memory
|
||||
set indentexpr=ResetIndentexpr()
|
||||
new
|
||||
call feedkeys("i\<c-f>", 'x')
|
||||
call assert_equal('', &indentexpr)
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user