diff options
Diffstat (limited to 'src/out-plutil.c')
| -rw-r--r-- | src/out-plutil.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/out-plutil.c b/src/out-plutil.c index 5354aa3..bf9e72e 100644 --- a/src/out-plutil.c +++ b/src/out-plutil.c @@ -312,6 +312,13 @@ static plist_err_t _node_estimate_size(node_t node, uint64_t *size, uint32_t dep return PLIST_ERR_INVALID_ARG; } + if (depth > PLIST_MAX_NESTING_DEPTH) { +#if DEBUG + fprintf(stderr, "libplist: ERROR: maximum nesting depth (%u) exceeded\n", (unsigned)PLIST_MAX_NESTING_DEPTH); +#endif + return PLIST_ERR_MAX_NESTING; + } + if (hash_table_lookup(visited, node)) { #if DEBUG fprintf(stderr, "libplist: ERROR: circular reference detected\n"); |
