diff options
Diffstat (limited to 'include/toml++')
| -rw-r--r-- | include/toml++/impl/preprocessor.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/toml++/impl/preprocessor.hpp b/include/toml++/impl/preprocessor.hpp index ff2ce6dd23..d74d2b616c 100644 --- a/include/toml++/impl/preprocessor.hpp +++ b/include/toml++/impl/preprocessor.hpp @@ -1177,9 +1177,11 @@ #endif #ifndef TOML_MAX_NESTED_VALUES -#define TOML_MAX_NESTED_VALUES 256 +#define TOML_MAX_NESTED_VALUES 128 // this refers to the depth of nested values, e.g. inline tables and arrays. -// 256 is crazy high! if you're hitting this limit with real input, TOML is probably the wrong tool for the job... +// 128 is very generous; real TOML files rarely exceed single-digit nesting. +// keep this value low enough to avoid stack overflows in sanitizer-instrumented builds +// where each recursion cycle may consume ~3KB of stack. #endif #ifndef TOML_MAX_DOTTED_KEYS_DEPTH |
