mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
fix potential NULL dereferences found by coverity
This commit is contained in:
5
cJSON.c
5
cJSON.c
@ -167,6 +167,11 @@ static const unsigned char *parse_number(cJSON *item, const unsigned char *num)
|
||||
double number = 0;
|
||||
unsigned char *endpointer = NULL;
|
||||
|
||||
if (num == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
number = strtod((const char*)num, (char**)&endpointer);
|
||||
if ((num == endpointer) || (num == NULL))
|
||||
{
|
||||
|
Reference in New Issue
Block a user