0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

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

@@ -1896,9 +1896,12 @@ channel_parse_json(channel_T *channel, ch_part_T part)
/* When a message is incomplete we wait for a short while for more to
* arrive. After the delay drop the input, otherwise a truncated string
* or list will make us hang. */
* or list will make us hang.
* Do not generate error messages, they will be written in a channel log. */
++emsg_silent;
status = json_decode(&reader, &listtv,
chanpart->ch_mode == MODE_JS ? JSON_JS : 0);
--emsg_silent;
if (status == OK)
{
/* Only accept the response when it is a list with at least two