[DO NOT MERGE] Dummy PR to check for coverity integration#46
Open
hirrangandhid wants to merge 1 commit intodevelopfrom
Open
[DO NOT MERGE] Dummy PR to check for coverity integration#46hirrangandhid wants to merge 1 commit intodevelopfrom
hirrangandhid wants to merge 1 commit intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
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 insendProbeRequest(). - Changes build flags to suppress
-Werror=formatby 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 |
Contributor
There was a problem hiding this comment.
Coverity Issue - Resource leak
Handle variable "fd" going out of scope leaks the handle.
High Impact, CWE-404
RESOURCE_LEAK
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[DO NOT MERGE] Dummy PR to check for coverity integration