Skip to content

fix: add maximum nesting depth for PDF object parsing#66

Open
jgheithcock wants to merge 1 commit into
ledongthuc:masterfrom
jgheithcock:fix/max-recursion-depth
Open

fix: add maximum nesting depth for PDF object parsing#66
jgheithcock wants to merge 1 commit into
ledongthuc:masterfrom
jgheithcock:fix/max-recursion-depth

Conversation

@jgheithcock
Copy link
Copy Markdown

Summary

Limit the recursion depth in readObject() to prevent excessive resource consumption when parsing deeply nested PDF structures. Returns an error if parsing past the limit (1000 objects).

This prevents stack overflow on recursively nested PDF objects.

Testing

Added read_test.go with go test coverage for object/dict/array nesting beyond the new limit.

Limit the recursion depth in readObject() to prevent excessive resource
consumption when parsing deeply nested PDF structures. Returns an error
if parsing past the limit.
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.

1 participant