1
0
forked from aniani/vim

patch 8.2.5072: using uninitialized value and freed memory in spell command

Problem:    Using uninitialized value and freed memory in spell command.
Solution:   Initialize "attr".  Check for empty line early.
This commit is contained in:
Bram Moolenaar
2022-06-09 19:54:24 +01:00
parent f5465ff5c8
commit 2813f38e02
3 changed files with 24 additions and 3 deletions

View File

@@ -802,5 +802,20 @@ func Test_word_index()
call delete('Xtmpfile')
endfunc
func Test_check_empty_line()
" This was using freed memory
enew
spellgood!
norm z=
norm yy
sil! norm P]svc
norm P]s
" set 'encoding' to clear the wordt list
set enc=latin1
set enc=utf-8
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab