summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_spell.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-07-01 22:26:20 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-01 22:26:20 +0100
commit5e59ea54c0c37c2f84770f068d95280069828774 (patch)
tree09f0c34da420d6aff84c745647201844c15fcfab /src/testdir/test_spell.vim
parentf12129f1714f7d2301935bb21d896609bdac221c (diff)
patch 9.0.0021: invalid memory access when adding word to spell word listv9.0.0021
Problem: Invalid memory access when adding word with a control character to the internal spell word list. Solution: Disallow adding a word with control characters or a trailing slash.
Diffstat (limited to 'src/testdir/test_spell.vim')
-rw-r--r--src/testdir/test_spell.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim
index 0fd5ed9178..0187a175a8 100644
--- a/src/testdir/test_spell.vim
+++ b/src/testdir/test_spell.vim
@@ -854,6 +854,21 @@ func Test_spellsuggest_too_deep()
bwipe!
endfunc
+func Test_spell_good_word_invalid()
+ " This was adding a word with a 0x02 byte, which causes havoc.
+ enew
+ norm o0
+ sil! norm rzzWs00/
+ 2
+ sil! norm VzGprzzW
+ sil! norm z=
+
+ bwipe!
+ " clear the internal word list
+ set enc=latin1
+ set enc=utf-8
+endfunc
+
func LoadAffAndDic(aff_contents, dic_contents)
set enc=latin1
set spellfile=