diff --git a/cJSON.c b/cJSON.c index 891cab3..975bcab 100644 --- a/cJSON.c +++ b/cJSON.c @@ -100,7 +100,7 @@ static unsigned char* cJSON_strdup(const unsigned char* str, const internal_hook return NULL; } - len = strlen((const char*)str) + 1; + len = strlen((const char*)str) + sizeof(""); if (!(copy = (unsigned char*)hooks->allocate(len))) { return NULL;