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

Change return type of cre2_set_compile from int to bool #29

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

Conversation

hopper-vul
Copy link

The inner implementation RE2::Set::Compile() will return true for success and false for failure of prog_ compilation.
Other APIs return -1 to inform an error, however this API use 0.
The cast int type will confuse developers to use the null prog_ without properly checking the returned status and then cause crash.

fixes: #27

Signed-off-by: hopper-vul [email protected]

The inner implementation RE2::Set::Compile() will return true for success
and false for failure of prog_ compilation. The cast int type will confuse
developers to use the null prog_ without checking the returned status and then
cause crash.

Signed-off-by: hopper-vul <[email protected]>
@hopper-vul
Copy link
Author

@marcomaggi Hi, would you please review this PR? I'm looking forward to your feedback.

Thanks.

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.

crash caused by confusing return type of cre2_set_compile
1 participant