File vim-8.0.1568-CVE-2022-0361.patch of Package vim.23083

--- vim-8.0.1568.orig/src/ex_cmds.c	2022-02-03 20:50:13.621648993 +0200
+++ vim-8.0.1568/src/ex_cmds.c	2022-02-08 12:33:36.662677163 +0200
@@ -983,6 +983,8 @@
     }
 
     appended_lines_mark(n, count);
+    if (VIsual_active)
+	check_pos(curbuf, &VIsual);
 
     msgmore((long)count);
 }
--- vim-8.0.1568.orig/src/testdir/test_visual.vim	2022-02-03 20:50:13.645648707 +0200
+++ vim-8.0.1568/src/testdir/test_visual.vim	2022-02-08 12:32:34.964824336 +0200
@@ -187,3 +187,16 @@
 	      \ 'AB	IJKLMNO	QRst'], getline(12, 13))
   enew!
 endfunc
+
+" this was leaving the end of the Visual area beyond the end of a line
+func Test_visual_ex_copy_line()
+  new
+  call setline(1, ["aaa", "bbbbbbbbbxbb"])
+  /x
+  exe "normal ggvjfxO"
+  t0
+  normal gNU
+  bwipe!
+endfunc
+
+

openSUSE Build Service is sponsored by