FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix based on Coverity and Sonar audits (part 4) by stelfrag · Pull Request #22332 · netdata/netdata · GitHub

Fix based on Coverity and Sonar audits (part 4) - #22332

Merged
stelfrag merged 2 commits into
netdata:masterfrom
stelfrag:cov_fix_202604_part4
May 1, 2026
Merged

Fix based on Coverity and Sonar audits (part 4)#22332
stelfrag merged 2 commits into
netdata:masterfrom
stelfrag:cov_fix_202604_part4

Conversation

Copy link
Copy Markdown
Collaborator

ktsaou added 2 commits April 30, 2026 09:49
Coverity CID 503493 (DEADCODE): in send_curl_request(), the failure path of
curl_slist_append() called curl_slist_free_all() through `if(headers)` -- but
`headers` is initialized to NULL on entry and only assigned after the append
succeeds. The condition can never be true and the free is unreachable.

Drop the dead block. The remaining cleanup (curl_easy_cleanup, can_retry=false,
return false) is unchanged and correct.
Sonar c:S1763: the `default:` case of the WndProc switch ended with
`return DefWindowProc(...);` followed by `break;`. The break was
unreachable. Remove the dead line.

Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

cubic-dev-ai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@stelfrag I have started the AI code review. It will take a few minutes to complete.

stelfrag marked this pull request as ready for review May 1, 2026 07:23
stelfrag requested a review from Ferroin as a code owner May 1, 2026 07:23
Copilot AI review requested due to automatic review settings May 1, 2026 07:23
stelfrag marked this pull request as draft May 1, 2026 07:23
stelfrag requested review from thiagoftsm and removed request for Ferroin May 1, 2026 07:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Continues the Coverity/Sonar audit cleanup series by removing two unreachable code paths in the claim UI and claim API request code.

Changes:

  • Remove an unreachable break after return DefWindowProc() in the Windows claim UI window procedure.
  • Remove an unreachable curl_slist_free_all(headers) in the curl_slist_append() failure path (since headers is still NULL there).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/claim/ui.c Deletes unreachable break in WndProc() default case.
src/claim/claim-with-api.c Deletes unreachable header-list cleanup on curl_slist_append() failure when headers cannot yet be non-NULL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

stelfrag marked this pull request as ready for review May 1, 2026 08:04
stelfrag merged commit 7b6fddb into netdata:master May 1, 2026
204 of 207 checks passed
stelfrag deleted the cov_fix_202604_part4 branch May 1, 2026 08:24
stelfrag mentioned this pull request Jun 22, 2026
Ferroin pushed a commit that referenced this pull request Jul 15, 2026
* claim: drop unreachable curl_slist cleanup on append failure

Coverity CID 503493 (DEADCODE): in send_curl_request(), the failure path of
curl_slist_append() called curl_slist_free_all() through `if(headers)` -- but
`headers` is initialized to NULL on entry and only assigned after the append
succeeds. The condition can never be true and the free is unreachable.

Drop the dead block. The remaining cleanup (curl_easy_cleanup, can_retry=false,
return false) is unchanged and correct.

* claim: drop unreachable break in WndProc default case

Sonar c:S1763: the `default:` case of the WndProc switch ended with
`return DefWindowProc(...);` followed by `break;`. The break was
unreachable. Remove the dead line.

---------

Co-authored-by: Costa Tsaousis <costa@netdata.cloud>
(cherry picked from commit 7b6fddb)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL