summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/vim/files/0002-patch-8.2.3582-reading-uninitialized-memory-when-giv.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/vim/files/0002-patch-8.2.3582-reading-uninitialized-memory-when-giv.patch')
-rw-r--r--meta/recipes-support/vim/files/0002-patch-8.2.3582-reading-uninitialized-memory-when-giv.patch63
1 files changed, 0 insertions, 63 deletions
diff --git a/meta/recipes-support/vim/files/0002-patch-8.2.3582-reading-uninitialized-memory-when-giv.patch b/meta/recipes-support/vim/files/0002-patch-8.2.3582-reading-uninitialized-memory-when-giv.patch
deleted file mode 100644
index d117a98893..0000000000
--- a/meta/recipes-support/vim/files/0002-patch-8.2.3582-reading-uninitialized-memory-when-giv.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1CVE: CVE-2021-3928
2Upstream-Status: Backport
3Signed-off-by: Ross Burton <ross.burton@arm.com>
4
5From ade0f0481969f1453c60e7c8354b00dfe4238739 Mon Sep 17 00:00:00 2001
6From: Bram Moolenaar <Bram@vim.org>
7Date: Thu, 4 Nov 2021 15:46:05 +0000
8Subject: [PATCH] patch 8.2.3582: reading uninitialized memory when giving
9 spell suggestions
10
11Problem: Reading uninitialized memory when giving spell suggestions.
12Solution: Check that preword is not empty.
13---
14 src/spellsuggest.c | 2 +-
15 src/testdir/test_spell.vim | 8 ++++++++
16 src/version.c | 2 ++
17 3 files changed, 11 insertions(+), 1 deletion(-)
18
19diff --git a/src/spellsuggest.c b/src/spellsuggest.c
20index 9d6df7930..8615d5280 100644
21--- a/src/spellsuggest.c
22+++ b/src/spellsuggest.c
23@@ -1600,7 +1600,7 @@ suggest_trie_walk(
24 // char, e.g., "thes," -> "these".
25 p = fword + sp->ts_fidx;
26 MB_PTR_BACK(fword, p);
27- if (!spell_iswordp(p, curwin))
28+ if (!spell_iswordp(p, curwin) && *preword != NUL)
29 {
30 p = preword + STRLEN(preword);
31 MB_PTR_BACK(preword, p);
32diff --git a/src/testdir/test_spell.vim b/src/testdir/test_spell.vim
33index 79fb8927c..e435e9172 100644
34--- a/src/testdir/test_spell.vim
35+++ b/src/testdir/test_spell.vim
36@@ -498,6 +498,14 @@ func Test_spell_screendump()
37 call delete('XtestSpell')
38 endfunc
39
40+func Test_spell_single_word()
41+ new
42+ silent! norm 0R00
43+ spell! ßÂ
44+ silent 0norm 0r$ Dvz=
45+ bwipe!
46+endfunc
47+
48 let g:test_data_aff1 = [
49 \"SET ISO8859-1",
50 \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
51diff --git a/src/version.c b/src/version.c
52index df4ec9a47..e1bc0d09b 100644
53--- a/src/version.c
54+++ b/src/version.c
55@@ -742,6 +742,8 @@ static char *(features[]) =
56
57 static int included_patches[] =
58 { /* Add new patch number below this line */
59+/**/
60+ 3582,
61 /**/
62 3581,
63 /**/