mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
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)
f1f6f3f7df
This commit is contained in:

committed by
Justin M. Keyes

parent
009c695f0a
commit
cf59d617bc
@@ -1668,8 +1668,8 @@ static char_u * do_one_cmd(char_u **cmdlinep,
|
|||||||
if (*ea.cmd == ';') {
|
if (*ea.cmd == ';') {
|
||||||
if (!ea.skip) {
|
if (!ea.skip) {
|
||||||
curwin->w_cursor.lnum = ea.line2;
|
curwin->w_cursor.lnum = ea.line2;
|
||||||
// Don't leave the cursor on an illegal line (caused by ';')
|
// don't leave the cursor on an illegal line or column
|
||||||
check_cursor_lnum();
|
check_cursor();
|
||||||
}
|
}
|
||||||
} else if (*ea.cmd != ',') {
|
} else if (*ea.cmd != ',') {
|
||||||
break;
|
break;
|
||||||
|
@@ -250,9 +250,21 @@ func Test_remove_char_in_cmdline()
|
|||||||
call assert_equal('"def', @:)
|
call assert_equal('"def', @:)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_illegal_address()
|
func Test_illegal_address1()
|
||||||
new
|
new
|
||||||
2;'(
|
2;'(
|
||||||
2;')
|
2;')
|
||||||
quit
|
quit
|
||||||
endfunc
|
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
|
||||||
|
|
||||||
|
@@ -628,7 +628,7 @@ static const int included_patches[] = {
|
|||||||
// 327,
|
// 327,
|
||||||
326,
|
326,
|
||||||
325,
|
325,
|
||||||
// 324,
|
324,
|
||||||
// 323,
|
// 323,
|
||||||
322,
|
322,
|
||||||
// 321,
|
// 321,
|
||||||
|
Reference in New Issue
Block a user