Skip to content

fix: add depth limit to prevent parser crash#871

Open
JohannesLks wants to merge 1 commit intogoogle:masterfrom
JohannesLks:fix/parser-depth-limit
Open

fix: add depth limit to prevent parser crash#871
JohannesLks wants to merge 1 commit intogoogle:masterfrom
JohannesLks:fix/parser-depth-limit

Conversation

@JohannesLks
Copy link
Copy Markdown

Fixes #870
Deeply nested input exhausts the goroutine stack, causing an unrecoverable fatal error that bypasses recover(). Add a depth counter to parse() with a limit of 500 (matching MaxStack).

Deeply nested input exhausts the goroutine stack, causing an
unrecoverable fatal error that bypasses recover(). Add a depth
counter to parse() with a limit of 500 (matching MaxStack).

Signed-off-by: Lukas Johannes Moller <research@johannes-moeller.dev>
@JohannesLks JohannesLks force-pushed the fix/parser-depth-limit branch from 6b418c5 to 43a0d07 Compare April 6, 2026 19:04
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.

Parser crashes on deeply nested input

1 participant