Mercurial > vim
diff src/channel.c @ 7918:ce5a7a613867 v7.4.1255
commit https://github.com/vim/vim/commit/66624ff0d9e1de2fc5eb4f95f3a3a2ed70b10138
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 3 23:59:43 2016 +0100
patch 7.4.1255
Problem: Crash for channel "eval" command without third argument.
Solution: Check for missing argument.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 04 Feb 2016 00:00:05 +0100 |
parents | 54602dcac207 |
children | e44240b5a6da |
line wrap: on
line diff
--- a/src/channel.c +++ b/src/channel.c @@ -694,7 +694,7 @@ channel_exe_cmd(int idx, char_u *cmd, ty { int is_eval = cmd[1] == 'v'; - if (is_eval && arg3->v_type != VAR_NUMBER) + if (is_eval && (arg3 == NULL || arg3->v_type != VAR_NUMBER)) { if (p_verbose > 2) EMSG("E904: third argument for eval must be a number"); @@ -774,7 +774,7 @@ may_invoke_callback(int idx) typval_T *arg3 = NULL; char_u *cmd = typetv->vval.v_string; - /* ["cmd", arg] */ + /* ["cmd", arg] or ["cmd", arg, arg] */ if (list->lv_len == 3) arg3 = &list->lv_last->li_tv; channel_exe_cmd(idx, cmd, &argv[1], arg3);