From c2d22090a4b20492125384fca186f743660b27d2 Mon Sep 17 00:00:00 2001 From: xinyingchao Date: Thu, 17 Mar 2022 16:03:20 +0800 Subject: [PATCH] cve patch test cases are rectified --- backport-CVE-2022-0361.patch | 25 +++++++++++++++++-------- backport-CVE-2022-0368.patch | 10 +++++----- vim.spec | 8 +++++++- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/backport-CVE-2022-0361.patch b/backport-CVE-2022-0361.patch index f0ad2e0..c809606 100644 --- a/backport-CVE-2022-0361.patch +++ b/backport-CVE-2022-0361.patch @@ -8,11 +8,11 @@ Problem: Illegal memory access when copying lines in Visual mode. Solution: Adjust the Visual position after copying lines. --- src/ex_cmds.c | 2 ++ - src/testdir/test_visual.vim | 11 +++++++++++ - 2 files changed, 13 insertions(+) + src/testdir/test_visual.vim | 13 +++++++++++-- + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ex_cmds.c b/src/ex_cmds.c -index 8f6444f..cccdf47 100644 +index fea6dfa..aa97b40 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -864,6 +864,8 @@ ex_copy(linenr_T line1, linenr_T line2, linenr_T n) @@ -25,12 +25,21 @@ index 8f6444f..cccdf47 100644 msgmore((long)count); } diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index 3ed927a..dbc28eb 100644 +index 3ed927a..f82d75b 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim -@@ -659,6 +659,17 @@ func Test_linewise_select_mode() +@@ -658,8 +658,6 @@ func Test_linewise_select_mode() + call append('$', ['a', 'b', 'c']) exe "normal GkkgH\" call assert_equal(['', 'b', 'c'], getline(1, '$')) +- +- + " linewise select mode: delete middle two lines + call deletebufline('', 1, '$') + call append('$', ['a', 'b', 'c']) +@@ -681,6 +679,17 @@ func Test_linewise_select_mode() + bwipe! + endfunc +" this was leaving the end of the Visual area beyond the end of a line +func Test_visual_ex_copy_line() @@ -43,9 +52,9 @@ index 3ed927a..dbc28eb 100644 + bwipe! +endfunc + + func Test_visual_mode_put() + new - " linewise select mode: delete middle two lines - call deletebufline('', 1, '$') -- -1.8.3.1 +2.27.0 diff --git a/backport-CVE-2022-0368.patch b/backport-CVE-2022-0368.patch index 8f34f22..ed8cfac 100644 --- a/backport-CVE-2022-0368.patch +++ b/backport-CVE-2022-0368.patch @@ -12,10 +12,10 @@ Solution: Correct the Visual area after undo. 2 files changed, 17 insertions(+) diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index dbc28eb..cf7e351 100644 +index f82d75b..fcf6473 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim -@@ -670,6 +670,21 @@ func Test_visual_ex_copy_line() +@@ -690,6 +690,21 @@ func Test_visual_ex_copy_line() bwipe! endfunc @@ -34,9 +34,9 @@ index dbc28eb..cf7e351 100644 + bwipe! +endfunc + + func Test_visual_mode_put() + new - " linewise select mode: delete middle two lines - call deletebufline('', 1, '$') diff --git a/src/undo.c b/src/undo.c index 54a6e1c..706dee9 100644 --- a/src/undo.c @@ -51,5 +51,5 @@ index 54a6e1c..706dee9 100644 smsg_attr_keep(0, _("%ld %s; %s #%ld %s"), u_oldcount < 0 ? -u_oldcount : u_oldcount, -- -1.8.3.1 +2.27.0 diff --git a/vim.spec b/vim.spec index fc1e077..e8a2801 100644 --- a/vim.spec +++ b/vim.spec @@ -12,7 +12,7 @@ Name: vim Epoch: 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. License: Vim and MIT URL: http://www.vim.org @@ -480,6 +480,12 @@ popd %{_mandir}/man1/evim.* %changelog +* Sat Mar 19 2022 yuanxin - 2:8.2-31 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:cve patch test cases are rectified + * Wed Mar 09 2022 shixuantong - 2:8.2-30 - Type:CVE - ID:CVE-2022-0685 -- Gitee