summaryrefslogtreecommitdiff
path: root/src/testdir/test_spell_utf8.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-09 19:54:24 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-09 19:54:24 +0100
commit2813f38e021c6e6581c0c88fcf107e41788bc835 (patch)
treeb8a6f78b5fe373c594ea6e7719f86b99495de8ee /src/testdir/test_spell_utf8.vim
parentf5465ff5c83f5a8a3e05bec64a0c013e5bdeb46e (diff)
downloadvim-git-2813f38e021c6e6581c0c88fcf107e41788bc835.tar.gz
patch 8.2.5072: using uninitialized value and freed memory in spell commandv8.2.5072
Problem: Using uninitialized value and freed memory in spell command. Solution: Initialize "attr". Check for empty line early.
Diffstat (limited to 'src/testdir/test_spell_utf8.vim')
-rw-r--r--src/testdir/test_spell_utf8.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_spell_utf8.vim b/src/testdir/test_spell_utf8.vim
index ef08f9535..f9f85a63a 100644
--- a/src/testdir/test_spell_utf8.vim
+++ b/src/testdir/test_spell_utf8.vim
@@ -802,5 +802,20 @@ func Test_word_index()
call delete('Xtmpfile')
endfunc
+func Test_check_empty_line()
+ " This was using freed memory
+ enew
+ spellgood! fl
+ 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