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

Added patches to zip.c to prevent OOM while fuzzing #369

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

capuanob
Copy link
Contributor

Responding to https://github.com/kuba--/zip/pull/367#discussion_r1958774563

This PR adds a compiler definition specific to OSSFUZZ builds and bails prior to attempting to malloc beyond 1 gigabyte while fuzzing

@capuanob
Copy link
Contributor Author

@kuba-- See a proposed fix to what we were discussing above

@kuba--
Copy link
Owner

kuba-- commented Feb 18, 2025

I think the check is not where the real problem is. It happens IMO on zip_stream_open - when we open the compressed stream for reading (not a file).
https://github.com/kuba--/zip/blob/master/fuzz/read_entry_fuzzer.c#L10

Moreover, we can add those checks/asserts inside fuzz package.

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.

2 participants