yob / pdf-reader

The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe.
MIT License
1.81k stars 271 forks source link

Raise MalformedPDFError when xref offset is a negative number #435

Closed yob closed 2 years ago

yob commented 2 years ago

A byte offset < 0 doesn't make much sense. This is unlikely to happen, but in theory some corrupted PDFs might have a line that looks like a negative int preceding the %%EOF

This was highlighted by the fuzzer added in #429