1
0
forked from aniani/vim

patch 8.1.2282: crash when passing many arguments through a partial

Problem:    Crash when passing many arguments through a partial. (Andy
            Massimino)
Solution:   Check the number of arguments. (closes #5186)
This commit is contained in:
Bram Moolenaar
2019-11-10 00:13:50 +01:00
parent ee85702c10
commit 4c054e9fb2
7 changed files with 41 additions and 5 deletions

View File

@@ -2527,6 +2527,12 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
list = argvars[arg_idx].vval.v_list;
if (list == NULL || list->lv_len == 0)
arg_idx = 0;
else if (list->lv_len > MAX_FUNC_ARGS)
{
emsg_funcname((char *)e_toomanyarg, name);
vim_free(name);
goto theend;
}
}
}
if (dict_idx > 0 || arg_idx > 0 || arg_pt != NULL || is_funcref)