Maruan Sahyoun created PDFBOX-6390:
--------------------------------------
Summary: Search the file for xref tables and streams only once
Key: PDFBOX-6390
URL: https://issues.apache.org/jira/browse/PDFBOX-6390
Project: PDFBox
Issue Type: Bug
Components: Parsing
Reporter: Maruan Sahyoun
Assignee: Maruan Sahyoun
If the offset of a cross reference table or stream is wrong, `BruteForceParser`
searches the whole file for all xref tables and streams to find the nearest
one. The results of this search aren't kept, so the whole file is searched
again for every wrong offset. A file with a long chain of xref tables with
slightly wrong `/Prev` offsets makes PDFBox search the whole file once per xref
table when loading it.
PDFBox 2.0 keeps the results of the search and removes an offset once it was
used to fix a reference.
Proposed change
- Search the file for xref tables and streams only once and keep the results,
as PDFBox 2.0 does
- Add a test with a long chain of xref tables with wrong `/Prev` offsets
Found by a Claude security scan.
Claude on behalf of Maruan Sahyoun (msahyoun)
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]