vim-patch:8.2.4214: illegal memory access with large 'tabstop' in Ex mode

Problem:    Illegal memory access with large 'tabstop' in Ex mode.
Solution:   Allocate enough memory.
85b6747abc
This commit is contained in:
Christian Clason 2022-01-26 16:36:05 +01:00
parent 17e2938b10
commit de673966c3
2 changed files with 11 additions and 1 deletions

View File

@ -772,7 +772,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
ccline.cmdindent = (s->firstc > 0 ? s->indent : 0);
// alloc initial ccline.cmdbuff
alloc_cmdbuff(exmode_active ? 250 : s->indent + 1);
alloc_cmdbuff(indent + 50);
ccline.cmdlen = ccline.cmdpos = 0;
ccline.cmdbuff[0] = NUL;

View File

@ -98,4 +98,14 @@ func Test_ex_mode_count_overflow()
call delete('Xexmodescript')
endfunc
func Test_ex_mode_large_indent()
new
set ts=500 ai
call setline(1, "\t")
exe "normal gQi\<CR>."
set ts=8 noai
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab