summaryrefslogtreecommitdiffstats
path: root/debian/patches/CVE-2022-2285.patch
blob: db103c662d48bcb2f66bc65bd904fb7a9b4d1bf5 (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
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(+)

--- 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 */
--- 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
+