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

More OSS-Fuzz support #5328

Merged
merged 18 commits into from Mar 28, 2021
Merged

More OSS-Fuzz support #5328

merged 18 commits into from Mar 28, 2021

Conversation

wiredfool
Copy link
Member

Changes proposed in this pull request:

  • Delegate build.sh, build-dictionaries to Pillow. This requires a further commit in oss-fuzz after this merges to master
  • Add a fuzzer for font files. This opens truetype files and performs some basic operations with them.
  • Refactor and add tests for the fuzzers. This should catch any cases of the fuzzers totally failing with unexpected errors, but we are still expecting that there are a reasonable number of exceptions thrown due to attempting to load broken input.
  • Lint fixes

@wiredfool
Copy link
Member Author

Test failure appears to be unrelated.

"path", subprocess.check_output("find Tests/fonts -type f", shell=True).split(b"\n")
)
def test_fuzz_fonts(path):
if not path or b"LICENSE.txt" in path or b".pil" in path:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not path or b"LICENSE.txt" in path or b".pil" in path:
if not path or path.endswith(b"LICENSE.txt") or path.endswith(b".pil"):

from PIL import Image

if sys.platform.startswith("win32"):
pytest.skip("Fuzzer is linux only", allow_module_level=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pytest.skip("Fuzzer is linux only", allow_module_level=True)
pytest.skip("Fuzzer is macOS and Linux only", allow_module_level=True)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, technically, it's linux only, but the required bits don't fail on osx because it includes the find command.

Comment on lines +43 to +47
"path", subprocess.check_output("find Tests/fonts -type f", shell=True).split(b"\n")
)
def test_fuzz_fonts(path):
if not path:
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"path", subprocess.check_output("find Tests/fonts -type f", shell=True).split(b"\n")
)
def test_fuzz_fonts(path):
if not path:
return
"path", subprocess.check_output("find Tests/fonts -type f", shell=True).strip().split(b"\n")
)
def test_fuzz_fonts(path):

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.

None yet

3 participants