From 8c78d89041b713bffcb0b09fee4468304a3a54d5 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 10 Feb 2026 17:45:12 +0100 Subject: plist: Make plist copy and free implementations iterative Convert plist_free_node() and plist_copy_node() to iterative implementations. This avoids unbounded recursion and stack overflow when handling deeply nested plist data, while preserving existing semantics and caches. --- src/plist.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plist.h') diff --git a/src/plist.h b/src/plist.h index e310bcc..7228696 100644 --- a/src/plist.h +++ b/src/plist.h @@ -49,9 +49,15 @@ #endif #endif +#include "node.h" + #ifndef PLIST_MAX_NESTING_DEPTH +#ifdef NODE_MAX_DEPTH +#define PLIST_MAX_NESTING_DEPTH NODE_MAX_DEPTH +#else #define PLIST_MAX_NESTING_DEPTH 512 #endif +#endif #include "plist/plist.h" -- cgit v1.1-32-gdbae