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 null checks in as_release_vercmp #206

Closed

Conversation

davidmhewitt
Copy link
Contributor

As as_release_get_version can return NULL, it would be wise to do some null checks here before passing to the compare method.

@ximion
Copy link
Owner

ximion commented Oct 12, 2018

I was coincidentally looking at this as well just few hours ago.
My patch fixes the issue differently, in the string comparison function itself. This protects every (internal) user of the API against crashes when passing NULL to the function by accident.
The code is also smaller, g_strcmp0 handles NULL values well already - problems can only exist of only one of the version numbers passed in happens to be NULL.

Thanks for your patch anyway and for noticing the issue!

@davidmhewitt
Copy link
Contributor Author

Yeah, no worries, that makes more sense. Thanks for your feedback and fix!

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

2 participants