Mercurial > vim
diff src/eval.c @ 7937:2e905dfc6999 v7.4.1264
commit https://github.com/vim/vim/commit/6076fe1986255d32b7a078a28bf9e7bea19d6f30
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 5 22:49:56 2016 +0100
patch 7.4.1264
Problem: Crash when receiving an empty array.
Solution: Check for array with wrong number of arguments. (Damien)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 05 Feb 2016 23:00:05 +0100 |
parents | 3f2e0b62003d |
children | e875f0fbd9c0 |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -9875,18 +9875,12 @@ f_ch_sendexpr(typval_T *argvars, typval_ { if (channel_read_json_block(ch_idx, id, &listtv) == OK) { - if (listtv->v_type == VAR_LIST) - { - list_T *list = listtv->vval.v_list; - - if (list->lv_len == 2) - { - /* Move the item from the list and then change the type to - * avoid the value being freed. */ - *rettv = list->lv_last->li_tv; - list->lv_last->li_tv.v_type = VAR_NUMBER; - } - } + list_T *list = listtv->vval.v_list; + + /* Move the item from the list and then change the type to + * avoid the value being freed. */ + *rettv = list->lv_last->li_tv; + list->lv_last->li_tv.v_type = VAR_NUMBER; clear_tv(listtv); } }