DaveGamble / cJSON

Ultralightweight JSON parser in ANSI C
MIT License
10.68k stars 3.21k forks source link

fix strlen(null) #797

Open ZhaoYandong00 opened 10 months ago

ZhaoYandong00 commented 10 months ago

When used in this way, it may cause errors : strlen(null)

cJSON* json= cJSON_CreateObject(); json->type = cJSON_String; cJSON_SetValuestring(json,string);