From 228a3050695d222dc77e2cab9993396e045dcdfb Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 27 Mar 2025 00:44:24 +0100 Subject: Fix segmentation fault when calling plist_sort() on an empty dictionary Credit to @Anza2001 --- src/plist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/plist.c b/src/plist.c index 514c8e5..f0f0028 100644 --- a/src/plist.c +++ b/src/plist.c @@ -1808,6 +1808,9 @@ void plist_sort(plist_t plist) } else if (PLIST_IS_DICT(plist)) { node_t node = (node_t)plist; node_t ch; + if (!node_first_child(node)) { + return; + } for (ch = node_first_child(node); ch; ch = node_next_sibling(ch)) { ch = node_next_sibling(ch); plist_sort((plist_t)ch); -- cgit v1.1-32-gdbae