diff --git a/backport-CVE-2022-0319.patch b/backport-CVE-2022-0319.patch index f56640f1c004c5c8dff6177752ae2d6e6766dc0c..8bb828f953b5c5b7a2aec5ccfe4018187f08042f 100644 --- a/backport-CVE-2022-0319.patch +++ b/backport-CVE-2022-0319.patch @@ -15,10 +15,10 @@ Conflict:NA 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim -index 9194a1b..deb82c0 100644 +index fcf6473..4f8f056 100644 --- a/src/testdir/test_visual.vim +++ b/src/testdir/test_visual.vim -@@ -685,6 +685,16 @@ func Test_visual_undo_deletes_last_line() +@@ -705,6 +705,16 @@ func Test_visual_undo_deletes_last_line() bwipe! endfunc @@ -32,11 +32,11 @@ index 9194a1b..deb82c0 100644 + bwipe! +endfunc + + func Test_visual_mode_put() + new - " linewise select mode: delete middle two lines - call deletebufline('', 1, '$') diff --git a/src/window.c b/src/window.c -index b66fb34..03f7dc6 100644 +index 5b407d5..bb17167 100644 --- a/src/window.c +++ b/src/window.c @@ -1661,6 +1661,11 @@ win_exchange(long Prenum) @@ -51,7 +51,7 @@ index b66fb34..03f7dc6 100644 win_enter(wp, TRUE); redraw_all_later(NOT_VALID); } -@@ -5115,7 +5120,7 @@ frame_remove(frame_T *frp) +@@ -5114,7 +5119,7 @@ frame_remove(frame_T *frp) win_alloc_lines(win_T *wp) { wp->w_lines_valid = 0; diff --git a/backport-CVE-2022-0361.patch b/backport-CVE-2022-0361.patch index f0ad2e0b4c918bf3f9f5111ff9b75d12b45f89cd..c809606856afa628ffc5855961c796464ef2fedc 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 8f34f2264f5d5a02cc1cbaa2321a08231d03bba2..ed8cfac48e03287ff3639802f8b6015c0216434f 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 35cbce0bec89f3ec84d7ae67bbd574ac26d7a4cd..887616145cc09fd2b116d94ed4c0c2bf824b3a46 100644 --- a/vim.spec +++ b/vim.spec @@ -11,7 +11,7 @@ Name: vim Epoch: 2 Version: 8.2 -Release: 22 +Release: 23 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 @@ -483,6 +483,12 @@ LC_ALL=en_US.UTF-8 make -j1 test %{_mandir}/man1/evim.* %changelog +* Sat Mar 19 2022 yuanxin - 2:8.2-23 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:cve patch test cases are rectified + * Wed Mar 09 2022 shixuantong - 2:8.2-22 - Type:CVE - ID:CVE-2022-0685