From: Markus Koschany Date: Wed, 19 Oct 2022 19:21:36 +0200 Subject: CVE-2021-3928 Origin: https://github.com/vim/vim/commit/15d9890eee53afc61eb0a03b878a19cb5672f732 --- src/spell.c | 2 +- src/testdir/test_spell.vim | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) --- a/src/spell.c +++ b/src/spell.c @@ -4616,7 +4616,7 @@ suggest_trie_walk( * char, e.g., "thes," -> "these". */ p = fword + sp->ts_fidx; MB_PTR_BACK(fword, p); - if (!spell_iswordp(p, curwin)) + if (!spell_iswordp(p, curwin) && *preword != NUL) { p = preword + STRLEN(preword); MB_PTR_BACK(preword, p); --- a/src/testdir/test_spell.vim +++ b/src/testdir/test_spell.vim @@ -436,6 +436,16 @@ func RunGoodBad(good, bad, expected_word bwipe! endfunc +func Test_spell_single_word() + set spell + new + silent! norm 0R00 + spell! ß + silent 0norm 0r$ Dvz= + set nospell + bwipe! +endfunc + let g:test_data_aff1 = [ \"SET ISO8859-1", \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",