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

Check file iterator for being NULL consistently #1784

Merged
merged 1 commit into from Sep 28, 2021

Conversation

ffesti
Copy link
Contributor

@ffesti ffesti commented Sep 22, 2021

No point in allowing NULL only for one of the arguments.

Thanks to ex0z3 (https://github.com/ex0z3) for reporting!

Resolves: #1782

No point in allowing NULL only for one of the arguments.

Thanks to ex0z3 (https://github.com/ex0z3) for reporting!

Resolves: rpm-software-management#1782
Copy link
Member

@pmatilai pmatilai left a comment

Choose a reason for hiding this comment

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

The existing NULL checks probably predate existience of fi->files, and nobody (cough) thought to check to double-check for those NULLs when that was introduced. At two separate checks, it's a bit borderline whether it would be more readable with the check moved outside the call. The reason it's written the way it is, is to avoid having to maintain error codes twice, but that could be achieved in other ways too.

@ffesti
Copy link
Contributor Author

ffesti commented Sep 28, 2021

Yeah, not beautiful but just good enough for now.

@ffesti ffesti merged commit 470498b into rpm-software-management:master Sep 28, 2021
@ffesti ffesti deleted the 1782 branch October 14, 2021 11:27
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.

Check for NULL after dereference in rpmfi.c
2 participants