From c46c4d155967336776f697b4b0dd238ce89fed46 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Wed, 28 Jun 2017 15:59:53 +0200 Subject: [PATCH] handle null pointer: sort_object --- cJSON_Utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index bcdbb64..3e317ae 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -550,6 +550,10 @@ static cJSON *sort_list(cJSON *list, const cJSON_bool case_sensitive) static void sort_object(cJSON * const object, const cJSON_bool case_sensitive) { + if (object == NULL) + { + return; + } object->child = sort_list(object->child, case_sensitive); }