Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_bu
default:
goto loop_end;
}
if (number_string_length > CJSON_NUMBER_LENGTH_LIMIT)
{
return false;
}
}
loop_end:
/* malloc for temporary buffer, add 1 for '\0' */
Expand Down
4 changes: 4 additions & 0 deletions cJSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJ
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512

#ifndef CJSON_NUMBER_LENGTH_LIMIT
#define CJSON_NUMBER_LENGTH_LIMIT 512
#endif

/* The cJSON structure: */
typedef struct cJSON
{
Expand Down