summaryrefslogtreecommitdiffstats
path: root/src/plist.h
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2026-02-10 17:45:12 +0100
committerGravatar Nikias Bassen2026-02-10 17:45:12 +0100
commit8c78d89041b713bffcb0b09fee4468304a3a54d5 (patch)
tree2c9427e2382b47c2aaf724a074fadafde415c066 /src/plist.h
parent9ef0d05265198ede1fd14271ab3f4812d34ebe2e (diff)
downloadlibplist-8c78d89041b713bffcb0b09fee4468304a3a54d5.tar.gz
libplist-8c78d89041b713bffcb0b09fee4468304a3a54d5.tar.bz2
plist: Make plist copy and free implementations iterativeHEADmaster
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.
Diffstat (limited to 'src/plist.h')
-rw-r--r--src/plist.h6
1 files changed, 6 insertions, 0 deletions
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"