forked from aniani/vim
patch 8.0.0170: crash in channel test
Problem: Channel test fails for using freed memory. Solution: Fix memory use in json_decode().
This commit is contained in:
@@ -577,6 +577,8 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
|
|||||||
ga_init2(&stack, sizeof(json_dec_item_T), 100);
|
ga_init2(&stack, sizeof(json_dec_item_T), 100);
|
||||||
cur_item = res;
|
cur_item = res;
|
||||||
init_tv(&item);
|
init_tv(&item);
|
||||||
|
if (res != NULL)
|
||||||
|
init_tv(res);
|
||||||
|
|
||||||
fill_numbuflen(reader);
|
fill_numbuflen(reader);
|
||||||
p = reader->js_buf + reader->js_used;
|
p = reader->js_buf + reader->js_used;
|
||||||
@@ -985,7 +987,6 @@ item_end:
|
|||||||
|
|
||||||
theend:
|
theend:
|
||||||
ga_clear(&stack);
|
ga_clear(&stack);
|
||||||
clear_tv(&item);
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
170,
|
||||||
/**/
|
/**/
|
||||||
169,
|
169,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user