From 8601838022f06cd9ddbc27eba4202d6af96a2386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20M=C3=B6ller?= Date: Mon, 13 Mar 2023 21:11:17 +0100 Subject: [PATCH] Add missing length check --- cJSON.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cJSON.c b/cJSON.c index 524ba46..2b42374 100644 --- a/cJSON.c +++ b/cJSON.c @@ -778,6 +778,11 @@ static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_bu unsigned char *output = NULL; /* not a string */ + if (!can_access_at_index(input_buffer, 0)) + { + goto fail; + } + if (buffer_at_offset(input_buffer)[0] != '\"') { goto fail;