Problem: tabpanel: undefined behaviour with large tabpanelop columns
(Michał Majchrowicz)
Solution: Error out for too large column values
Co-authored-by: Michał Majchrowicz <mmajchrowicz@afine.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
{
char_u *p;
int new_align = ALIGN_LEFT;
- int new_columns = 20;
+ long new_columns = 20;
int new_is_vert = FALSE;
p = p_tplo;
{
p += 8;
new_columns = getdigits(&p);
+ if (new_columns < 1 || new_columns > 1000)
+ return FAIL;
}
else if (STRNCMP(p, "vert", 4) == 0)
{
bw!
endfunc
+func Test_tabpanel_large_columns()
+ call assert_fails(':set tabpanelopt=columns:10001', 'E474:')
+ call assert_fails(':set tabpanelopt=columns:-1', 'E474:')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 273,
/**/
272,
/**/