diff --git a/cJSON.c b/cJSON.c index f6dd11c..8f44a50 100644 --- a/cJSON.c +++ b/cJSON.c @@ -778,7 +778,7 @@ static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_bu unsigned char *output = NULL; /* not a string */ - if (buffer_at_offset(input_buffer)[0] != '\"') + if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != '\"') { goto fail; }