cve patch test cases are rectified

This commit is contained in:
xinyingchao 2022-03-17 15:57:01 +08:00
parent 9643662e71
commit 6719bf74ed
3 changed files with 29 additions and 14 deletions

View File

@ -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\<Del>"
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

View File

@ -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

View File

@ -12,7 +12,7 @@
Name: vim
Epoch: 2
Version: 8.2
Release: 26
Release: 27
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
@ -476,6 +476,12 @@ popd
%{_mandir}/man1/evim.*
%changelog
* Sat Mar 19 2022 yuanxin <yuanxin24@h-partners.com> - 2:8.2-27
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:cve patch test cases are rectified
* Wed Mar 09 2022 shixuantong <shixuantong@h-partners.com> - 2:8.2-26
- Type:CVE
- ID:CVE-2022-0685