Repository navigation
ROB: Do not crash when the XFA entry is not a well-formed array - #4064
Merged
stefan6419846 merged 1 commit intoSep 10, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4064 +/- ##
=======================================
Coverage 98.10% 98.11%
=======================================
Files 59 59
Lines 11477 11480 +3
Branches 2148 2149 +1
=======================================
+ Hits 11260 11264 +4
Misses 122 122
+ Partials 95 94 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
approved these changes
Sep 10, 2026
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.
reader.xfa iterates /XFA in tag/value pairs after casting it to an array, so a
malformed entry crashes rather than being reported.
Two cases:
not iterable", or exhausts the iterator for a string. The spec also permits a
stream here, which the pairwise walk cannot consume.
raises StopIteration out of the property, because next(i) has nothing left.
The entry is now checked before iterating, warning and returning no XFA data
the way an absent /AcroForm does, and the paired read tolerates a missing
value instead of raising.
Offline suite passes, 1318 tests. tests/test_reader.py::test_read_pdf15_xref_stream
fails here with FileNotFoundError both with and without this change, so I could
not verify against the downloaded corpus.
Used Claude (Opus) to help locate and patch this; I reviewed and tested the change.