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

Coverity 20190924 #6941

Merged
merged 4 commits into from
Oct 2, 2019
Merged

Coverity 20190924 #6941

merged 4 commits into from
Oct 2, 2019

Conversation

thiagoftsm
Copy link
Contributor

Summary

Fixes part of #6924

This PR fixes 4 issues that are present in our code according Coverity. I did not touch some collectors, because I will need to study more the code to understand what we have there and the database engine that Markos is already taking care.

Component Name

Health
Daemon

Additional Information

In the switch the library stops case this pointer is NULL, so
there is not necessity to processed with tests
The current code tries to copy the same size of the variable, another possible
solution would be to use a function to sanitize the code, I will try this first
Considering that we are testing the variable value one line above
The division will always happen
For this specific case we do not have the possibility to have memory
leak, valgrind confirms this, but I am adding a new variable here to the
stack to discard the warning
@squash-labs
Copy link

squash-labs bot commented Sep 24, 2019

Manage this branch in Squash

Test this branch here: https://thiagoftsmcoverity-20190924-odya0.squash.io

@netdatabot netdatabot added area/collectors Everything related to data collection area/daemon area/libnetdata labels Sep 24, 2019
@thiagoftsm thiagoftsm self-assigned this Sep 25, 2019
@thiagoftsm thiagoftsm added this to the v1.18-Sprint3 milestone Sep 25, 2019
@thiagoftsm thiagoftsm merged commit f197e2d into netdata:master Oct 2, 2019
Saruspete pushed a commit to Saruspete/netdata that referenced this pull request Oct 9, 2019
* coverity_20190924: Fix 215633

In the switch the library stops case this pointer is NULL, so
there is not necessity to processed with tests

* coverity_20190924: Fix 338067

The current code tries to copy the same size of the variable, another possible
solution would be to use a function to sanitize the code, I will try this first

* coverity_20190924: Fix 348638

Considering that we are testing the variable value one line above
The division will always happen

* coverity_20190924: Fix 348640

For this specific case we do not have the possibility to have memory
leak, valgrind confirms this, but I am adding a new variable here to the
stack to discard the warning
@thiagoftsm thiagoftsm deleted the coverity_20190924 branch November 13, 2019 12:03
jackyhuang85 pushed a commit to jackyhuang85/netdata that referenced this pull request Jan 1, 2020
* coverity_20190924: Fix 215633

In the switch the library stops case this pointer is NULL, so
there is not necessity to processed with tests

* coverity_20190924: Fix 338067

The current code tries to copy the same size of the variable, another possible
solution would be to use a function to sanitize the code, I will try this first

* coverity_20190924: Fix 348638

Considering that we are testing the variable value one line above
The division will always happen

* coverity_20190924: Fix 348640

For this specific case we do not have the possibility to have memory
leak, valgrind confirms this, but I am adding a new variable here to the
stack to discard the warning
Saruspete pushed a commit to Saruspete/netdata that referenced this pull request May 21, 2020
* coverity_20190924: Fix 215633

In the switch the library stops case this pointer is NULL, so
there is not necessity to processed with tests

* coverity_20190924: Fix 338067

The current code tries to copy the same size of the variable, another possible
solution would be to use a function to sanitize the code, I will try this first

* coverity_20190924: Fix 348638

Considering that we are testing the variable value one line above
The division will always happen

* coverity_20190924: Fix 348640

For this specific case we do not have the possibility to have memory
leak, valgrind confirms this, but I am adding a new variable here to the
stack to discard the warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection area/daemon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants