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

table plugin: Assert that result_num is zero when result is NULL. #2565

Merged
merged 2 commits into from Nov 20, 2017

Conversation

octo
Copy link
Member

@octo octo commented Nov 20, 2017

The Coverity check gets confused by the tbl->results == NULL check: due to the check, is assumes that tbl->results may be NULL. It then discovers the dereference in tbl_clear() without realizing that "result" and "result_num" are linked and that situation can't happen. This assertion makes this link a bit easier to conclude.

CID: 37966

The Coverity check gets confused by the `tbl->results == NULL` check:
due to the check, is assumes that tbl->results *may* be NULL. It then
discovers the dereference in tbl_clear() without realizing that "result"
and "result_num" are linked and that situation can't happen. This
assertion makes this link a bit easier to conclude.

CID: 37966
Increase the number of elements in the successful path only, instead of
increasing it immediately and decreasing on error.
@octo octo added Automerge Labels PRs to be merged by a bot once approved Cleanup labels Nov 20, 2017
@collectd-bot collectd-bot added this to the 5.7 milestone Nov 20, 2017
@octo octo changed the title Cid/37966 table plugin: Assert that result_num is zero when result is NULL. Nov 20, 2017
@collectd-bot collectd-bot merged commit 87c071e into collectd:collectd-5.7 Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automerge Labels PRs to be merged by a bot once approved Cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants