mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.2666: Vim9: not enough function arguments checked for string
Problem: Vim9: not enough function arguments checked for string. Solution: Check in ch_logfile(), char2nr() and others.
This commit is contained in:
@@ -2521,6 +2521,8 @@ f_changenr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_char2nr(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
if (has_mbyte)
|
||||
{
|
||||
int utf8 = 0;
|
||||
@@ -2685,11 +2687,16 @@ f_confirm(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
char_u *typestr;
|
||||
int error = FALSE;
|
||||
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
message = tv_get_string_chk(&argvars[0]);
|
||||
if (message == NULL)
|
||||
error = TRUE;
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 1) == FAIL)
|
||||
return;
|
||||
buttons = tv_get_string_buf_chk(&argvars[1], buf);
|
||||
if (buttons == NULL)
|
||||
error = TRUE;
|
||||
@@ -2698,6 +2705,8 @@ f_confirm(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
def = (int)tv_get_number_chk(&argvars[2], &error);
|
||||
if (argvars[3].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 3) == FAIL)
|
||||
return;
|
||||
typestr = tv_get_string_buf_chk(&argvars[3], buf2);
|
||||
if (typestr == NULL)
|
||||
error = TRUE;
|
||||
|
Reference in New Issue
Block a user