1
0
mirror of https://github.com/DaveGamble/cJSON synced 2024-12-25 16:12:04 +00:00

Utils: InplaceDecodePointerString: Check for NULL

This commit is contained in:
Max Bruckner 2017-01-30 19:29:52 +01:00
parent c49ffbfba8
commit a2309a509d

View File

@ -208,6 +208,11 @@ cJSON *cJSONUtils_GetPointer(cJSON *object, const char *pointer)
static void cJSONUtils_InplaceDecodePointerString(char *string) static void cJSONUtils_InplaceDecodePointerString(char *string)
{ {
char *s2 = string; char *s2 = string;
if (string == NULL) {
return;
}
for (; *string; s2++, string++) for (; *string; s2++, string++)
{ {
*s2 = (*string != '~') *s2 = (*string != '~')