aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKunMing Xie <qqzz014@gmail.com>2017-09-18 02:04:17 +0800
committerJustin M. Keyes <justinkz@gmail.com>2017-09-17 20:04:17 +0200
commitcf59d617bc6d2aabb487c4d6be8082160a633a39 (patch)
tree25a98a8730e212c6134869a945a4b9a41b1a40a9
parent009c695f0a6c6da322f89e0f621d59d596e712fa (diff)
downloadrneovim-cf59d617bc6d2aabb487c4d6be8082160a633a39.tar.gz
rneovim-cf59d617bc6d2aabb487c4d6be8082160a633a39.tar.bz2
rneovim-cf59d617bc6d2aabb487c4d6be8082160a633a39.zip
vim-patch:8.0.0324 (#7279)
Problem: Illegal memory access with "1;y". Solution: Call check_cursor() instead of check_cursor_lnum(). (Dominique Pelle, closes vim/vim#1455) https://github.com/vim/vim/commit/f1f6f3f7df2938b3583e341482d96c1d53124c51
-rw-r--r--src/nvim/ex_docmd.c4
-rw-r--r--src/nvim/testdir/test_cmdline.vim14
-rw-r--r--src/nvim/version.c2
3 files changed, 16 insertions, 4 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index d1405978b3..bef5fd287e 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -1668,8 +1668,8 @@ static char_u * do_one_cmd(char_u **cmdlinep,
if (*ea.cmd == ';') {
if (!ea.skip) {
curwin->w_cursor.lnum = ea.line2;
- // Don't leave the cursor on an illegal line (caused by ';')
- check_cursor_lnum();
+ // don't leave the cursor on an illegal line or column
+ check_cursor();
}
} else if (*ea.cmd != ',') {
break;
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 2facffb067..c0f04f4730 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -250,9 +250,21 @@ func Test_remove_char_in_cmdline()
call assert_equal('"def', @:)
endfunc
-func Test_illegal_address()
+func Test_illegal_address1()
new
2;'(
2;')
quit
endfunc
+
+func Test_illegal_address2()
+ call writefile(['c', 'x', ' x', '.', '1;y'], 'Xtest.vim')
+ new
+ source Xtest.vim
+ " Trigger calling validate_cursor()
+ diffsp Xtest.vim
+ quit!
+ bwipe!
+ call delete('Xtest.vim')
+endfunc
+
diff --git a/src/nvim/version.c b/src/nvim/version.c
index e4142dea98..1f040b214b 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -628,7 +628,7 @@ static const int included_patches[] = {
// 327,
326,
325,
- // 324,
+ 324,
// 323,
322,
// 321,