summaryrefslogtreecommitdiffstats
path: root/debian/patches/CVE-2022-2285.patch
blob: 5105f02ca4364a23ed8a75e4657e8816ba21761d (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, 2 Nov 2022 22:34:23 +0100
Subject: CVE-2022-2285

Origin: https://github.com/vim/vim/commit/27efc62f5d86afcb2ecb7565587fe8dea4b036fe
---
 src/term.c                   |  1 +
 src/testdir/test_mapping.vim | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/src/term.c b/src/term.c
index 47d2bda..bc46ed9 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4440,6 +4440,7 @@ check_termcode(
 	if (*tp == ESC && !p_ek && (State & INSERT))
 	    continue;
 
+	tp[len] = NUL;
 	key_name[0] = NUL;	/* no key name found yet */
 	key_name[1] = NUL;	/* no key name found yet */
 	modifiers = 0;		/* no modifiers yet */
diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim
index c454fc0..3c81bb5 100644
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -318,3 +318,13 @@ func Test_motionforce_omap()
   delfunc Select
   delfunc GetCommand
 endfunc
+
+func Test_using_past_typeahead()
+  nnoremap :00 0
+  exe "norm :set \x80\xfb0=0\<CR>"
+  exe "sil norm :0\x0f\<C-U>\<CR>"
+
+  exe "norm :set \x80\xfb0=\<CR>"
+  nunmap :00
+endfunc
+