Skip to content

[DO NOT MERGE] Dummy PR to check for coverity integration#46

Open
hirrangandhid wants to merge 1 commit intodevelopfrom
feature/dummy_PR_coverity
Open

[DO NOT MERGE] Dummy PR to check for coverity integration#46
hirrangandhid wants to merge 1 commit intodevelopfrom
feature/dummy_PR_coverity

Conversation

@hirrangandhid
Copy link
Contributor

@hirrangandhid hirrangandhid commented Feb 17, 2026

[DO NOT MERGE] Dummy PR to check for coverity integration

Copilot AI review requested due to automatic review settings February 17, 2026 11:59
@hirrangandhid hirrangandhid requested review from a team as code owners February 17, 2026 11:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR appears to intentionally introduce Coverity-detectable issues to validate Coverity integration (per the “[DO NOT MERGE] Dummy PR…” title) within the LM component.

Changes:

  • Adds an early NULL-parameter check to lm_send_rev() but introduces an FD leak on the error path.
  • Adds Coverity-noted items in presence detection code, including an unchecked pthread_mutex_init() and a new definite NULL dereference in sendProbeRequest().
  • Changes build flags to suppress -Werror=format by adding -Wno-error=format.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
source/lm/lm_api.c Adds NULL checks in lm_send_rev(), but introduces a socket FD leak on early return.
source/lm/device_presence_detection.c Adds Coverity-related notes/changes, including an unchecked mutex init and a new NULL dereference in sendProbeRequest().
source/lm/Makefile.am Adds a global compiler flag to downgrade format warnings from errors.

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

// COVERITY ISSUE: Resource leak - fd not closed on null pointer check failure
if(cmd == NULL || buff == NULL){
LM_LOG(("Null pointer passed\n"));
return LM_RET_ERR; // fd is not closed here - RESOURCE LEAK
Copy link
Contributor

Choose a reason for hiding this comment

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

Coverity Issue - Resource leak

Handle variable "fd" going out of scope leaks the handle.

High Impact, CWE-404
RESOURCE_LEAK

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.

2 participants

Comments