!177 cve patch test cases are rectified
From: @xinyingchao Reviewed-by: @xiezhipeng1 Signed-off-by: @xiezhipeng1
This commit is contained in:
commit
c8b8ee7ca4
@ -8,11 +8,11 @@ Problem: Illegal memory access when copying lines in Visual mode.
|
|||||||
Solution: Adjust the Visual position after copying lines.
|
Solution: Adjust the Visual position after copying lines.
|
||||||
---
|
---
|
||||||
src/ex_cmds.c | 2 ++
|
src/ex_cmds.c | 2 ++
|
||||||
src/testdir/test_visual.vim | 11 +++++++++++
|
src/testdir/test_visual.vim | 13 +++++++++++--
|
||||||
2 files changed, 13 insertions(+)
|
2 files changed, 13 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
|
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
|
--- a/src/ex_cmds.c
|
||||||
+++ b/src/ex_cmds.c
|
+++ b/src/ex_cmds.c
|
||||||
@@ -864,6 +864,8 @@ ex_copy(linenr_T line1, linenr_T line2, linenr_T n)
|
@@ -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);
|
msgmore((long)count);
|
||||||
}
|
}
|
||||||
diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim
|
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
|
--- a/src/testdir/test_visual.vim
|
||||||
+++ b/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>"
|
exe "normal GkkgH\<Del>"
|
||||||
call assert_equal(['', 'b', 'c'], getline(1, '$'))
|
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
|
+" this was leaving the end of the Visual area beyond the end of a line
|
||||||
+func Test_visual_ex_copy_line()
|
+func Test_visual_ex_copy_line()
|
||||||
@ -43,9 +52,9 @@ index 3ed927a..dbc28eb 100644
|
|||||||
+ bwipe!
|
+ bwipe!
|
||||||
+endfunc
|
+endfunc
|
||||||
+
|
+
|
||||||
|
func Test_visual_mode_put()
|
||||||
|
new
|
||||||
|
|
||||||
" linewise select mode: delete middle two lines
|
|
||||||
call deletebufline('', 1, '$')
|
|
||||||
--
|
--
|
||||||
1.8.3.1
|
2.27.0
|
||||||
|
|
||||||
|
|||||||
@ -12,10 +12,10 @@ Solution: Correct the Visual area after undo.
|
|||||||
2 files changed, 17 insertions(+)
|
2 files changed, 17 insertions(+)
|
||||||
|
|
||||||
diff --git a/src/testdir/test_visual.vim b/src/testdir/test_visual.vim
|
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
|
--- a/src/testdir/test_visual.vim
|
||||||
+++ b/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!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -34,9 +34,9 @@ index dbc28eb..cf7e351 100644
|
|||||||
+ bwipe!
|
+ bwipe!
|
||||||
+endfunc
|
+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
|
diff --git a/src/undo.c b/src/undo.c
|
||||||
index 54a6e1c..706dee9 100644
|
index 54a6e1c..706dee9 100644
|
||||||
--- a/src/undo.c
|
--- a/src/undo.c
|
||||||
@ -51,5 +51,5 @@ index 54a6e1c..706dee9 100644
|
|||||||
smsg_attr_keep(0, _("%ld %s; %s #%ld %s"),
|
smsg_attr_keep(0, _("%ld %s; %s #%ld %s"),
|
||||||
u_oldcount < 0 ? -u_oldcount : u_oldcount,
|
u_oldcount < 0 ? -u_oldcount : u_oldcount,
|
||||||
--
|
--
|
||||||
1.8.3.1
|
2.27.0
|
||||||
|
|
||||||
|
|||||||
8
vim.spec
8
vim.spec
@ -12,7 +12,7 @@
|
|||||||
Name: vim
|
Name: vim
|
||||||
Epoch: 2
|
Epoch: 2
|
||||||
Version: 8.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.
|
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
|
||||||
@ -476,6 +476,12 @@ popd
|
|||||||
%{_mandir}/man1/evim.*
|
%{_mandir}/man1/evim.*
|
||||||
|
|
||||||
%changelog
|
%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
|
* Wed Mar 09 2022 shixuantong <shixuantong@h-partners.com> - 2:8.2-26
|
||||||
- Type:CVE
|
- Type:CVE
|
||||||
- ID:CVE-2022-0685
|
- ID:CVE-2022-0685
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user