Blame SOURCES/0001-patch-8.2.4215-illegal-memory-access-when-copying-li.patch

9bb4fd
diff -up vim80/src/ex_cmds.c.cve0361 vim80/src/ex_cmds.c
9bb4fd
--- vim80/src/ex_cmds.c.cve0361	2022-02-08 12:20:51.277666290 +0100
9bb4fd
+++ vim80/src/ex_cmds.c	2022-02-08 12:20:51.280666209 +0100
9bb4fd
@@ -983,6 +983,8 @@ ex_copy(linenr_T line1, linenr_T line2,
9bb4fd
     }
9bb4fd
 
9bb4fd
     appended_lines_mark(n, count);
9bb4fd
+    if (VIsual_active)
9bb4fd
+	check_pos(curbuf, &VIsual);
9bb4fd
 
9bb4fd
     msgmore((long)count);
9bb4fd
 }
9bb4fd
diff -up vim80/src/testdir/test_visual.vim.cve0361 vim80/src/testdir/test_visual.vim
9bb4fd
--- vim80/src/testdir/test_visual.vim.cve0361	2022-02-08 12:20:51.280666209 +0100
9bb4fd
+++ vim80/src/testdir/test_visual.vim	2022-02-08 12:21:44.530356814 +0100
9bb4fd
@@ -263,3 +263,17 @@ func Test_visual_block_append_invalid_ch
9bb4fd
   call assert_equal(['	-   let xxx', 'xxxxx   -ˆ', 'xxxxxxxx-xxx'], getline(1, 3))
9bb4fd
   bwipe!
9bb4fd
 endfunc
9bb4fd
+
9bb4fd
+" this was leaving the end of the Visual area beyond the end of a line
9bb4fd
+func Test_visual_ex_copy_line()
9bb4fd
+  new
9bb4fd
+  call setline(1, ["aaa", "bbbbbbbbbxbb"])
9bb4fd
+  /x
9bb4fd
+  exe "normal ggvjfxO"
9bb4fd
+  t0
9bb4fd
+  normal gNU
9bb4fd
+  bwipe!
9bb4fd
+endfunc
9bb4fd
+
9bb4fd
+
9bb4fd
+" vim: shiftwidth=2 sts=2 expandtab