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

NetmaskTree: do not test node for null, the loop guarantees node is not null. #9078

Merged
merged 1 commit into from
May 4, 2020

Conversation

omoerbeek
Copy link
Member

Found by Coverity (1419400), which concludes that if node could be
null, the following node->node.first.getBits() would deref a nullptr.

Short description

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
  • checked that this code was merged to master

Found by Coverity (1419400), which concludes that if node could be
null, the following node->node.first.getBits() would deref a nullptr.
Copy link
Member

@rgacogne rgacogne left a comment

Choose a reason for hiding this comment

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

I agree that node can't be nullptr with the current code, either when first entering the loop or while iterating, so I guess that leaving that check provides a false feeling of safety.

@omoerbeek omoerbeek merged commit d54be2e into PowerDNS:master May 4, 2020
@omoerbeek omoerbeek deleted the coverity-1419400 branch May 4, 2020 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants