# HG changeset patch # User Bram Moolenaar # Date 1643112006 -3600 # Node ID 81d391f7c189b27a2d987b6e048ec8503674329e # Parent 718b899f73ea9233acb02caeb609c59d5f41e1e9 patch 8.2.4214: illegal memory access with large 'tabstop' in Ex mode Commit: https://github.com/vim/vim/commit/85b6747abc15a7a81086db31289cf1b8b17e6cb1 Author: Bram Moolenaar Date: Tue Jan 25 11:55:02 2022 +0000 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. diff --git a/src/ex_getln.c b/src/ex_getln.c --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1513,7 +1513,7 @@ init_ccline(int firstc, int indent) ccline.cmdindent = (firstc > 0 ? indent : 0); // alloc initial ccline.cmdbuff - alloc_cmdbuff(exmode_active ? 250 : indent + 1); + alloc_cmdbuff(indent + 50); if (ccline.cmdbuff == NULL) return FAIL; ccline.cmdlen = ccline.cmdpos = 0; diff --git a/src/testdir/test_ex_mode.vim b/src/testdir/test_ex_mode.vim --- a/src/testdir/test_ex_mode.vim +++ b/src/testdir/test_ex_mode.vim @@ -241,4 +241,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\." + set ts=8 noai + bwipe! +endfunc + + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4214, +/**/ 4213, /**/ 4212,