Skip to content
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 with PDFFileReader when file is empty #22

Closed
jerome-nexedi opened this issue Aug 16, 2013 · 3 comments
Closed

Infinite loop with PDFFileReader when file is empty #22

jerome-nexedi opened this issue Aug 16, 2013 · 3 comments
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF nf-security Non-functional change: Security

Comments

@jerome-nexedi
Copy link

jerome-nexedi commented Aug 16, 2013

Reproducible with:

import StringIO, PyPDF2

PyPDF2.PdfFileReader(StringIO.StringIO())
@mstamy2
Copy link
Collaborator

mstamy2 commented Aug 16, 2013

The infinite loop bug occurs in the ReadNextEndLine() method. We'll include a fix in the next patch - would it be acceptable to just throw an exception?

@mstamy2
Copy link
Collaborator

mstamy2 commented Aug 19, 2013

Added the fix for infinite loop caused by empty file just now - however I recently noticed that a StringIO object with random characters with cause an infinite loop as well instead of throwing an exception. We should be able to fix this easily.

@MartinThoma
Copy link
Member

This was solved pre 1.20, so I'll ignore it. I hope nobody still uses such an old version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF nf-security Non-functional change: Security
Projects
None yet
Development

No branches or pull requests

3 participants