Repository navigation
Enforce the byte limit on each PDF handed to hayro - #734
Merged
Merged
Conversation
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #733
What changed
Enforce
DocumentLimits.max_interpretation_sizeon the length of each PDF input supplied by the hayro bridge. The file prefix is checked before appearance synthesis. The output buffer enforces its own inclusive length limit as it reserves and appends, including written objects, render-only appearances and the cross-reference stream. Cached bridges are checked against the current caller's budget. Store-only edits and saves keep their existing behavior.The public API reference describes the bytes covered. The form and link tests now exercise the actual bridge representation, including the ability to read a document after a refused import. Decoder working memory and interpreter work remain tracked separately in #48 and #105.
Validation and next action
interpretation_sizeon cold and warm paths. Tests cover plain files, in-memory documents, encrypted input and edits, synthesized appearances, repeated builds on one budget, and preservation of the cached bridge on refusal. An encrypted PDF renders at its exact input length, refuses after an edit, and renders again after undo.python3 tools/check.py --locked rust, lockeduv sync, Ruff lint and format,ty check, the API reference check andgit diff --checkpassed.Next: verify current-head CI and review threads, squash-merge, and verify main. The issue handoff records the branch, validation and next action.