1
0
forked from aniani/vim

patch 8.0.0166: JSON with a duplicate key gives an internal error

Problem:    JSON with a duplicate key gives an internal error. (Lcd)
Solution:   Give a normal error.  Avoid an error when parsing JSON from a
            remote client fails.
This commit is contained in:
Bram Moolenaar
2017-01-10 15:15:37 +01:00
parent f446b48ff0
commit 03c60c1573
5 changed files with 36 additions and 5 deletions

View File

@@ -6818,8 +6818,7 @@ f_json_decode(typval_T *argvars, typval_T *rettv)
reader.js_buf = get_tv_string(&argvars[0]);
reader.js_fill = NULL;
reader.js_used = 0;
if (json_decode_all(&reader, rettv, 0) != OK)
EMSG(_(e_invarg));
json_decode_all(&reader, rettv, 0);
}
/*