-
Notifications
You must be signed in to change notification settings - Fork 611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite loop in xref table causes OOM #629
Comments
It is a good idea to prevent such endless loops. Can you share the PDF in question for analysis and tests? |
Unfortunately, the full pdf contains private/sensitive information and I'm not able to share it. I can share header data/data if it doesn't contain the private/sensitive info, if I'm directed on what data to share? |
If you cannot share it, that's ok. I merely prefer real-life test files, if only to be able to later point out that some error situation is not academical but real life. |
I've come across a PDF with the following xref table:
When I attempted to create a new PdfReader from this document, my application crashed with an OOM error.
Upon debugging, it looks like there is an infinite loop in the readXref() method:
as prev.intValue() is the same value as the startxref, which leads to a continuous allocation of memory until it crashes.
pdfinfo (by xdpfreader) confirms this:
I'm not very familiar with the pdf spec, so I'm not entirely sure if there is any other information needed. Please let me know if more info is necessary.
The text was updated successfully, but these errors were encountered: