0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.1264

Problem:    Crash when receiving an empty array.
Solution:   Check for array with wrong number of arguments. (Damien)
This commit is contained in:
Bram Moolenaar
2016-02-05 22:49:56 +01:00
parent 4d919d748e
commit 6076fe1986
4 changed files with 17 additions and 23 deletions

View File

@@ -9875,18 +9875,12 @@ f_ch_sendexpr(typval_T *argvars, typval_T *rettv)
{
if (channel_read_json_block(ch_idx, id, &listtv) == OK)
{
if (listtv->v_type == VAR_LIST)
{
list_T *list = listtv->vval.v_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;
}
}
/* 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);
}
}