summaryrefslogtreecommitdiffstats
path: root/src/json.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-02-28 15:21:13 +0100
committerBram Moolenaar <Bram@vim.org>2016-02-28 15:21:13 +0100
commit80e78847395b5c8ada7861674774d81bd0a42789 (patch)
treed888b4d1ed9fac19257d81972b2e60286a662d4c /src/json.c
parentb36287283781e09d8874157b9d9bdc5243a2f319 (diff)
patch 7.4.1446v7.4.1446
Problem: Crash when using json_decode(). Solution: Terminate string with a NUL byte.
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/json.c b/src/json.c
index d5019285b9..cf887e5afd 100644
--- a/src/json.c
+++ b/src/json.c
@@ -659,6 +659,7 @@ json_decode_string(js_read_T *reader, typval_T *res)
++reader->js_used;
if (res != NULL)
{
+ ga_append(&ga, NUL);
res->v_type = VAR_STRING;
#if defined(FEAT_MBYTE) && defined(USE_ICONV)
if (!enc_utf8)