From a2309a509d1aec2036d3f9491ae8b579ee664c92 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Mon, 30 Jan 2017 19:29:52 +0100 Subject: [PATCH] Utils: InplaceDecodePointerString: Check for NULL --- cJSON_Utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 71f3d84..02eadfc 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -208,6 +208,11 @@ cJSON *cJSONUtils_GetPointer(cJSON *object, const char *pointer) static void cJSONUtils_InplaceDecodePointerString(char *string) { char *s2 = string; + + if (string == NULL) { + return; + } + for (; *string; s2++, string++) { *s2 = (*string != '~')