Ver código fonte

Utils: InplaceDecodePointerString: Check for NULL

Max Bruckner 8 anos atrás
pai
commit
a2309a509d
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      cJSON_Utils.c

+ 5 - 0
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 != '~')