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

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

Conversation

pietermarsman
Copy link
Member

@pietermarsman pietermarsman commented Jul 7, 2024

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

  • I have read CONTRIBUTING.md.
  • I have added a concise human-readable description of the change to CHANGELOG.md.
  • I have tested that this fix is effective or that this feature works.
  • I have added docstrings to newly created methods and classes.
  • I have updated the README.md and the readthedocs documentation. Or verified that this is not necessary.

@pietermarsman pietermarsman added this pull request to the merge queue Jul 7, 2024
Merged via the queue into master with commit b9b75ff Jul 7, 2024
12 checks passed
@pietermarsman pietermarsman deleted the 971-oss-fuzz-issue-70071-pdfminersixpage_extraction_fuzzer-uncaught-exception-in-do_keyword branch July 7, 2024 15:06
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

Successfully merging this pull request may close these issues.

OSS-Fuzz issue 70071: pdfminersix:page_extraction_fuzzer: Uncaught exception in do_keyword
1 participant