Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): Limit recursion to block stackoverflow #404

Merged
merged 1 commit into from Dec 27, 2022
Merged

Conversation

epage
Copy link
Member

@epage epage commented Dec 27, 2022

Without the macros of the old parser, it was much easier to add new state for this. I chose the limit of 128 as that is what serde_json does.

I didn't both exposing more configuration for this than the unbounded feature. We can add more later if needed but I doubt that. Technically, this may break someone but the likelihood is extremely low, especially with how toml isn't exactly designed for arbitrary depth and with how recently this release was out.

Fixes #206

Without the macros of the old parser, it was much easier to add new
state for this.  I chose the limit of 128 as that is what serde_json
does.

I didn't both exposing more configuration for this than the `unbounded`
feature.  We can add more later if needed but I doubt that.
Technically, this may break someone but the likelihood is extremely low,
especially with how toml isn't exactly designed for arbitrary depth and
with how recently this release was out.

Fixes toml-rs#206
@epage epage merged commit 0c71a0f into toml-rs:main Dec 27, 2022
@epage epage deleted the limit branch December 27, 2022 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack overflow when parsing a deeply nested toml_edit::Document
1 participant