handle null pointers: cJSON_Minify

This commit is contained in:
Max Bruckner 2017-06-28 14:17:23 +02:00
parent 39745c9c75
commit 24ea388dcf

View File

@ -2390,6 +2390,12 @@ fail:
CJSON_PUBLIC(void) cJSON_Minify(char *json) CJSON_PUBLIC(void) cJSON_Minify(char *json)
{ {
unsigned char *into = (unsigned char*)json; unsigned char *into = (unsigned char*)json;
if (json == NULL)
{
return;
}
while (*json) while (*json)
{ {
if (*json == ' ') if (*json == ' ')