From: Markus Koschany 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\k