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.82k stars 271 forks source link

Check 1024 chars instead of 50 #298

Closed Jasmeet107 closed 5 years ago

Jasmeet107 commented 5 years ago

According to https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/pdf_reference_archives/PDFReference.pdf (Adobe PDF Spec) section 3.4.1 (File Header) 12, the header can appear within 1024 bytes of the file.

Right now we're only accounting for 50 bytes of junk in the header, so this should check for 1024.

Jasmeet107 commented 5 years ago

@yob :)

yob commented 5 years ago

Thanks!