mirror of
https://github.com/vim/vim.git
synced 2025-10-13 06:54:15 -04:00
patch 7.4.2235
Problem: submatch() does not check for a valid argument. Solution: Give an error if the argument is out of range. (Dominique Pelle)
This commit is contained in:
@@ -11491,7 +11491,11 @@ f_submatch(typval_T *argvars, typval_T *rettv)
|
||||
no = (int)get_tv_number_chk(&argvars[0], &error);
|
||||
if (error)
|
||||
return;
|
||||
error = FALSE;
|
||||
if (no < 0 || no >= NSUBEXP)
|
||||
{
|
||||
EMSGN(_("E935: invalid submatch number: %d"), no);
|
||||
return;
|
||||
}
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
retList = (int)get_tv_number_chk(&argvars[1], &error);
|
||||
if (error)
|
||||
|
Reference in New Issue
Block a user