!196 fix CVE-2022-0629
From: @wangjiang37 Reviewed-by: @overweight Signed-off-by: @overweight
This commit is contained in:
commit
95aecaeb53
48
backport-CVE-2022-0629.patch
Normal file
48
backport-CVE-2022-0629.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
From 34f8117dec685ace52cd9e578e2729db278163fc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Bram Moolenaar <Bram@vim.org>
|
||||||
|
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
|
||||||
|
|
||||||
9
vim.spec
9
vim.spec
@ -12,7 +12,7 @@
|
|||||||
Name: vim
|
Name: vim
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
Version: 8.2
|
Version: 8.2
|
||||||
Release: 30
|
Release: 31
|
||||||
Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text.
|
Summary: Vim is a highly configurable text editor for efficiently creating and changing any kind of text.
|
||||||
License: Vim and MIT
|
License: Vim and MIT
|
||||||
URL: http://www.vim.org
|
URL: http://www.vim.org
|
||||||
@ -92,6 +92,7 @@ Patch6055: backport-CVE-2022-0319.patch
|
|||||||
Patch6056: backport-CVE-2022-0554.patch
|
Patch6056: backport-CVE-2022-0554.patch
|
||||||
Patch6057: backport-CVE-2022-0943.patch
|
Patch6057: backport-CVE-2022-0943.patch
|
||||||
Patch6058: backport-CVE-2021-4069.patch
|
Patch6058: backport-CVE-2021-4069.patch
|
||||||
|
Patch6059: backport-CVE-2022-0629.patch
|
||||||
|
|
||||||
Patch9000: bugfix-rm-modify-info-version.patch
|
Patch9000: bugfix-rm-modify-info-version.patch
|
||||||
|
|
||||||
@ -480,6 +481,12 @@ popd
|
|||||||
%{_mandir}/man1/evim.*
|
%{_mandir}/man1/evim.*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Apr 1 2022 wangjiang <wangjiang37@h-partners.com> - 2:8.2-31
|
||||||
|
- Type:CVE
|
||||||
|
- ID:CVE-2022-0629
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:fix CVE-2022-0629
|
||||||
|
|
||||||
* Wed Mar 30 2022 wangjiang <wangjiang37#h-partners.com> - 2:8.2-30
|
* Wed Mar 30 2022 wangjiang <wangjiang37#h-partners.com> - 2:8.2-30
|
||||||
- Type:CVE
|
- Type:CVE
|
||||||
- ID:CVE-2021-4069
|
- ID:CVE-2021-4069
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user