From 14cf93754598b10b2f3c5229f5810036934253ba Mon Sep 17 00:00:00 2001 From: liubo Date: Mon, 13 May 2024 14:39:19 +0800 Subject: [PATCH] =?UTF-8?q?Description:=20=E8=B0=83=E7=94=A8parse=5Fstring?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0offset=E5=88=A4=E6=96=AD=20IssueNo:https://gi?= =?UTF-8?q?tee.com/openharmony/third=5Fparty=5FcJSON/issues/I9OUF5=20Binar?= =?UTF-8?q?y=20Source:No=20Signed-off-by:=20liubo419=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cJSON.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cJSON.c b/cJSON.c index a7379df..8e62531 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1659,6 +1659,11 @@ static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_bu current_item = new_item; } + if (cannot_access_at_index(input_buffer, 1)) + { + goto fail; /* nothing comes after the comma */ + } + /* parse the name of the child */ input_buffer->offset++; buffer_skip_whitespace(input_buffer); -- Gitee