From 563d861f921492dae64e810c6673c991f1d2d3e2 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Thu, 20 Dec 2018 18:12:23 +0100 Subject: [PATCH] cJSON_Utils: sort_lists: Properly split the lists Since `prev` is not used anymore after that by the algorithm it should have been fine anyways, still splitting it correctly in the first place is probably a good idea. Thanks @andysCaplin for the fix! --- cJSON_Utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index f0f9094..9d07fac 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -499,6 +499,7 @@ static cJSON *sort_list(cJSON *list, const cJSON_bool case_sensitive) { /* Split the lists */ second->prev->next = NULL; + second->prev = NULL; } /* Recursively sort the sub-lists. */