Mercurial > vim
diff src/channel.c @ 24250:01b274c3f69b v8.2.2666
patch 8.2.2666: Vim9: not enough function arguments checked for string
Commit: https://github.com/vim/vim/commit/c580943965fc9b006ec233bdee4ea5380f5594ea
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 27 21:23:30 2021 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Mar 2021 21:30:02 +0100 |
parents | a5bda73bc640 |
children | 8fdf839af1f4 |
line wrap: on
line diff
--- a/src/channel.c +++ b/src/channel.c @@ -4883,6 +4883,11 @@ f_ch_logfile(typval_T *argvars, typval_T // Don't open a file in restricted mode. if (check_restricted() || check_secure()) return; + if (in_vim9script() + && (check_for_string_arg(argvars, 0) == FAIL + || check_for_string_arg(argvars, 1) == FAIL)) + return; + fname = tv_get_string(&argvars[0]); if (argvars[1].v_type == VAR_STRING) opt = tv_get_string_buf(&argvars[1], buf);