From: Bram Moolenaar Date: Tue, 10 Jan 2017 21:57:34 +0000 (+0100) Subject: patch 8.0.0170: crash in channel test X-Git-Tag: v8.0.0170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e32abbe42c921c5e521420417abe5bc301e540b3;p=vim patch 8.0.0170: crash in channel test Problem: Channel test fails for using freed memory. Solution: Fix memory use in json_decode(). --- diff --git a/src/json.c b/src/json.c index 091d98f59..2cc3a2a39 100644 --- a/src/json.c +++ b/src/json.c @@ -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); cur_item = res; init_tv(&item); + if (res != NULL) + init_tv(res); fill_numbuflen(reader); p = reader->js_buf + reader->js_used; @@ -985,7 +987,6 @@ item_end: theend: ga_clear(&stack); - clear_tv(&item); return retval; } diff --git a/src/version.c b/src/version.c index 23dd5aeb6..4bc287fcc 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 170, /**/ 169, /**/