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

Unexpected AssertionError on malformed PDF #211

Open
Google-Autofuzz opened this issue Nov 13, 2020 · 0 comments
Open

Unexpected AssertionError on malformed PDF #211

Google-Autofuzz opened this issue Nov 13, 2020 · 0 comments

Comments

@Google-Autofuzz
Copy link

Google-Autofuzz commented Nov 13, 2020

When running the following code with the latest pypi version of pdfrw on the attached input results in an unexpected AssertionError:

import sys
from pdfrw import PdfReader

with open(sys.argv[1], 'rb') as f:
    PdfReader(io.BytesIO(f.read()))
$ python3 pypdf2_repro.py ../test.pdf
Traceback (most recent call last):
  File "pdfreader_repro.py", line 6, in <module>
    PdfReader(io.BytesIO(f.read()))
  File "/home/user/.local/lib/python3.8/site-packages/pdfrw/pdfreader.py", line 611, in __init__
    startloc, source = self.findxref(fdata)
  File "/home/user/.local/lib/python3.8/site-packages/pdfrw/pdfreader.py", line 333, in findxref
    assert tok == 'startxref'  # (We just checked this...)
AssertionError
$ 

test.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant