summaryrefslogtreecommitdiffstats
path: root/debian/patches/CVE-2023-1175.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/CVE-2023-1175.patch')
-rw-r--r--debian/patches/CVE-2023-1175.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/debian/patches/CVE-2023-1175.patch b/debian/patches/CVE-2023-1175.patch
new file mode 100644
index 0000000..0bc1497
--- /dev/null
+++ b/debian/patches/CVE-2023-1175.patch
@@ -0,0 +1,41 @@
+From: Markus Koschany <apo@debian.org>
+Date: Sun, 11 Jun 2023 13:56:10 +0200
+Subject: CVE-2023-1175
+
+Origin: https://github.com/vim/vim/commit/c99cbf8f289bdda5d4a77d7ec415850a520330ba
+---
+ src/ops.c | 2 ++
+ src/testdir/test_virtualedit.vim | 10 ++++++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/src/ops.c b/src/ops.c
+index 50d5af9..45e6308 100644
+--- a/src/ops.c
++++ b/src/ops.c
+@@ -3119,6 +3119,8 @@ op_yank(oparg_T *oap, int deleting, int mess)
+ * double-count it. */
+ bd.startspaces = (ce - cs + 1)
+ - oap->start.coladd;
++ if (bd.startspaces < 0)
++ bd.startspaces = 0;
+ startcol++;
+ }
+ }
+diff --git a/src/testdir/test_virtualedit.vim b/src/testdir/test_virtualedit.vim
+index 6b8fdfd..c2a9403 100644
+--- a/src/testdir/test_virtualedit.vim
++++ b/src/testdir/test_virtualedit.vim
+@@ -87,3 +87,13 @@ func Test_virtualedit_replace_after_tab()
+ bwipe!
+ endfunc
+
++func Test_edit_special_char()
++ new
++ se ve=all
++ norm a0
++ sil! exe "norm o00000\<Nul>k<a0s"
++
++ bwipe!
++ set virtualedit=
++endfunc
++