Skip to content

Add support for rejecting invalid inputs #245

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KanishAnand
Copy link

@KanishAnand KanishAnand commented Mar 7, 2024

Adds support to reject storing invalid inputs in corpus. There is an ongoing discussion about how to support this while preserving backward compatibility.

This PR adds two ways to reject invalid inputs:

  1. Defining LIBPROTOBUFMUTATOR_ENABLE_RETURN_CODE via the build system or #defineing it before including libfuzzer_macro.h.
  2. Using the DEFINE_PROTO_FUZZER_RET macro instead of DEFINE_PROTO_FUZZER.

@KanishAnand KanishAnand marked this pull request as ready for review May 30, 2024 15:48
@KanishAnand KanishAnand requested a review from vitalybuka as a code owner May 30, 2024 15:48
Copy link
Contributor

@hartwork hartwork left a comment

Choose a reason for hiding this comment

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

Hi @KanishAnand this seems like an important fix, thanks for your work on the topic! 👍 Personally I believe one of the two approaches being implemented simultaneously here — the build system version — makes things overly complex and "magic" without a strong enough return in value: One way, the new macro way, seems enough. So my vote would be to drop the everything LIBPROTOBUFMUTATOR_ENABLE_RETURN_CODE from the pull request but ideally after @vitalybuka has confirmed buy-in in the pull request in general and this very direction too, so that you don't waste your time. PS: I'm not a maintainer here.

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