Mercurial > vim
diff src/evalfunc.c @ 24246:35603c7991d7 v8.2.2664
patch 8.2.2664: Vim9: not enough function arguments checked for string
Commit: https://github.com/vim/vim/commit/32105ae88f3aa6a6af30336f0bc9f8eb81292cd7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 27 18:59:25 2021 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Mar 2021 19:00:04 +0100 |
parents | c784e176334c |
children | 01b274c3f69b |
line wrap: on
line diff
--- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -2323,8 +2323,12 @@ f_balloon_show(typval_T *argvars, typval } else { - char_u *mesg = tv_get_string_chk(&argvars[0]); - + char_u *mesg; + + if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL) + return; + + mesg = tv_get_string_chk(&argvars[0]); if (mesg != NULL) // empty string removes the balloon post_balloon(balloonEval, *mesg == NUL ? NULL : mesg, NULL); @@ -2338,8 +2342,11 @@ f_balloon_split(typval_T *argvars, typva { if (rettv_list_alloc(rettv) == OK) { - char_u *msg = tv_get_string_chk(&argvars[0]); - + char_u *msg; + + if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL) + return; + msg = tv_get_string_chk(&argvars[0]); if (msg != NULL) { pumitem_T *array;