diff src/testdir/test_spell_utf8.vim @ 29102:fd9006d6ddcf v8.2.5072

patch 8.2.5072: using uninitialized value and freed memory in spell command Commit: https://github.com/vim/vim/commit/2813f38e021c6e6581c0c88fcf107e41788bc835 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 9 19:54:24 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Thu, 09 Jun 2022 21:00:04 +0200
parents 77cd4bf3ad7d
children 6b0e4f2ba8ff
line wrap: on
line diff
--- 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