vim-patch:8.2.2664: Vim9: not enough function arguments checked for string

Problem:    Vim9: not enough function arguments checked for string.
Solution:   Check in balloon functions.  Refactor function arguments.
32105ae88f

Cherry-pick removal of useless check from patch 8.2.3840.

vim-patch:8.2.3083: crash when passing null string to charclass()

Problem:    Crash when passing null string to charclass().
Solution:   Bail out when string pointer is NULL. (Christian Brabandt,
            closes vim/vim#8498, closes vim/vim#8260)
72463f883c
This commit is contained in:
zeertzjq
2022-09-12 14:08:51 +08:00
parent 38059b4f31
commit 49aa9e17fa
3 changed files with 12 additions and 20 deletions

View File

@@ -2793,7 +2793,7 @@ void f_setcellwidths(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
void f_charclass(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
if (tv_check_for_string(&argvars[0], 1) == FAIL
if (tv_check_for_string_arg(argvars, 0) == FAIL
|| argvars[0].vval.v_string == NULL) {
return;
}