summaryrefslogtreecommitdiffstats
path: root/debian/patches/CVE-2022-0361.patch
blob: dae21d1208927b7d9f1b8a8e465bcd09237e00ae (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
From: Markus Koschany <apo@debian.org>
Date: Mon, 24 Oct 2022 00:58:11 +0200
Subject: CVE-2022-0361

Origin: https://github.com/vim/vim/commit/dc5490e2cbc8c16022a23b449b48c1bd0083f366
---
 src/ex_cmds.c               |  2 ++
 src/testdir/test_visual.vim | 11 +++++++++++
 2 files changed, 13 insertions(+)

--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1074,6 +1074,8 @@ ex_copy(linenr_T line1, linenr_T line2,
     }
 
     appended_lines_mark(n, count);
+    if (VIsual_active)
+	check_pos(curbuf, &VIsual);
 
     msgmore((long)count);
 }
--- a/src/testdir/test_visual.vim
+++ b/src/testdir/test_visual.vim
@@ -417,3 +417,14 @@ func Test_visual_block_append_invalid_ch
   bwipe!
 endfunc
 
+" CVE-2022-0361
+func Test_visual_ex_copy_line()
+  new
+  call setline(1, ["aaa", "bbbbbbbbbxbb"])
+  /x
+  exe "normal ggvjfxO"
+  t0
+  normal gNU
+  bwipe!
+endfunc
+