diff --git a/backport-CVE-2022-0629.patch b/backport-CVE-2022-0629.patch new file mode 100644 index 0000000000000000000000000000000000000000..9071a2bada1359013f358570d3ba1d2b6b618e90 --- /dev/null +++ b/backport-CVE-2022-0629.patch @@ -0,0 +1,48 @@ +From 34f8117dec685ace52cd9e578e2729db278163fc Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Wed, 16 Feb 2022 12:16:19 +0000 +Subject: [PATCH] patch 8.2.4397: crash when using many composing characters in + error message + +Problem: Crash when using many composing characters in error message. +Solution: Use mb_cptr2char_adv() instead of mb_ptr2char_adv(). +--- + src/testdir/test_assert.vim | 8 ++++++++ + src/testing.c | 2 +- + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/testdir/test_assert.vim b/src/testdir/test_assert.vim +index 1b1f9e5..1e7d66f 100644 +--- a/src/testdir/test_assert.vim ++++ b/src/testdir/test_assert.vim +@@ -45,6 +45,14 @@ func Test_assert_equal() + call assert_equal('XxxxxxxxxxxxxxxxxxxxxxX', 'XyyyyyyyyyyyyyyyyyyyyyyyyyX') + call assert_match("Expected 'X\\\\\\[x occurs 21 times]X' but got 'X\\\\\\[y occurs 25 times]X'", v:errors[0]) + call remove(v:errors, 0) ++ ++ " many composing characters are handled properly ++ call setline(1, ' ') ++ norm 100grƯ€ ++ call assert_equal(1, getline(1)) ++ call assert_match("Expected 1 but got '.* occurs 100 times]'", v:errors[0]) ++ call remove(v:errors, 0) ++ bwipe! + endfunc + + func Test_assert_equalfile() +diff --git a/src/testing.c b/src/testing.c +index f879f1e..f19481f 100644 +--- a/src/testing.c ++++ b/src/testing.c +@@ -99,7 +99,7 @@ ga_concat_shorten_esc(garray_T *gap, char_u *str) + { + same_len = 1; + s = p; +- c = mb_ptr2char_adv(&s); ++ c = mb_cptr2char_adv(&s); + clen = s - p; + while (*s != NUL && c == mb_ptr2char(s)) + { +-- +2.27.0 + diff --git a/vim.spec b/vim.spec index 7a19d6ca1f0997cacd0e43efa6376160d3bd00e0..3d568c46017d8b7ea44c70cab6f6ab53e2871e80 100644 --- a/vim.spec +++ b/vim.spec @@ -11,7 +11,7 @@ Name: vim Epoch: 2 Version: 8.2 -Release: 20 +Release: 21 Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text. License: Vim and MIT URL: http://www.vim.org @@ -77,6 +77,7 @@ Patch6043: backport-CVE-2022-0319.patch Patch6044: backport-CVE-2022-0554.patch Patch6045: backport-crash-when-pasting-too-many-times.patch Patch6046: backport-CVE-2022-0572.patch +Patch6047: backport-CVE-2022-0629.patch Patch9000: bugfix-rm-modify-info-version.patch Patch9001: remove-failed-tests-due-to-patch.patch @@ -479,6 +480,12 @@ LC_ALL=en_US.UTF-8 make -j1 test %{_mandir}/man1/evim.* %changelog +* Mon Feb 28 2022 yuanxin - 2:8.2-21 +- Type:CVE +- ID:CVE-2022-0629 +- SUG:NA +- DESC:fix CVE-2022-0629 + * Fri Feb 25 2022 yuanxin - 2:8.2-20 - Type:CVE - ID:CVE-2022-0572