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

Add fuzzing support in libmaxminddb #357

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

Conversation

pkillarjun
Copy link

@pkillarjun pkillarjun commented Nov 5, 2024

These are the bugs i found #356

My plans are to integrate libmaxminddb into OSS-Fuzz.

Signed-off-by: Arjun <pkillarjun@protonmail.com>
Copy link
Contributor

@horgh horgh left a comment

Choose a reason for hiding this comment

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

Cool! I have a few comments.

README.md Outdated Show resolved Hide resolved
if (status == MMDB_SUCCESS)
MMDB_close(&mmdb);

unlink(filename);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we want to error check any of these calls? This one, fwrite, fclose, sprintf could all have their return values checked I think.

Copy link
Author

Choose a reason for hiding this comment

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

This one, fwrite, fclose, sprintf could all have their return values checked I think.

Good idea, but too much voodoo, I guess.


fp = fopen(filename, "wb");
if (!fp)
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this or the above return something other than 0?

Copy link
Author

Choose a reason for hiding this comment

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

Should this or the above return something other than 0?

No, if the program returns anything else other than return 0;, the coverage won't be counted.
I get it; we could use return -1; or return 1;, but I would say let's keep it return 0; for consistency.

Souce LibFuzzer

Signed-off-by: Arjun <pkillarjun@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants