summaryrefslogtreecommitdiffstats
path: root/debian/patches/CVE-2021-3928.patch
blob: f7e17649ebd45a797e93abe6b403e8d6f164c52e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Markus Koschany <apo@debian.org>
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",