DaveGamble / cJSON

Ultralightweight JSON parser in ANSI C
MIT License
10.28k stars 3.15k forks source link

Add NULL check to cJSON_SetValuestring() #840

Closed Up-wind closed 2 months ago

Up-wind commented 3 months ago

If the valuestring passed to cJSON_SetValuestring is NULL, a null pointer dereference will happen.

This commit adds the NULL check of valuestring before it is dereferenced.

fixes: #839

Alanscut commented 2 months ago

LGTM.