pdfminer / pdfminer.six

Community maintained fork of pdfminer - we fathom PDF
https://pdfminersix.readthedocs.io
MIT License
5.96k stars 930 forks source link

Safely cast object id to integer in PDFParser to prevert TypeError and ValueError. #972

Closed pietermarsman closed 4 months ago

pietermarsman commented 4 months ago

Pull request

Fixes #971.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70071

Not assume that object can be converted to int. But use try-except in safe_int and return None if it can't be converted to int. Simply ignore the object if that is the case.

How Has This Been Tested?

With the nox tests. And with the fuzz blob.

Checklist