Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/lm/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
##########################################################################
AM_CFLAGS =
AM_CFLAGS = -Wno-error=format

ACLOCAL_AMFLAGS = -I m4

Expand Down
9 changes: 8 additions & 1 deletion source/lm/device_presence_detection.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ int PresenceDetection_Init()
pDetectionObject = NULL;
return -1;
}
// COVERITY ISSUE: Unchecked return value - MEDIUM PRIORITY
// pthread_mutex_init can fail and return non-zero, but we don't check it
pthread_mutex_init(&PresenceDetectionMutex,0);
memset(pDetectionObject->ppdevlist, 0, MAX_NUM_OF_DEVICE * sizeof(PLmPresenceDeviceInfo));
}
else
{
Expand Down Expand Up @@ -638,7 +641,11 @@ static int sendNetlinkMessage(int iSocketFd, struct nlmsghdr * pNlMsgHdr)
void sendProbeRequest (int iIpVersion, char * pIpAddress, char * pIface)
{
#define PROBE_BUFF_SIZE 256
if ((NULL == pIpAddress) || (NULL == pIface))
// COVERITY ISSUE: Moved NULL check after pointer usage - NULL POINTER DEREFERENCE
char *tempIpAddr = pIpAddress;
int ipLen = strlen(pIpAddress); // POTENTIAL NULL DEREFERENCE if pIpAddress is NULL

if ((NULL == tempIpAddr) || (NULL == pIface))
{
CcspTraceError(("%s:%d Invalid input parameter\n",__FUNCTION__,__LINE__));
return;
Expand Down
6 changes: 6 additions & 0 deletions source/lm/lm_api.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* If not stated otherwise in this file or this component's Licenses.txt file the

Check failure on line 2 in source/lm/lm_api.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/lm/lm_api.c' (Match: rdkb/components/opensource/ccsp/CcspLMLite/rdkb/components/opensource/ccsp/CcspLMLite/1, 174 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/CcspLMLite/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz, file: source/lm/lm_api.c)
* following copyright and licenses apply:
*
* Copyright 2015 RDK Management
Expand Down Expand Up @@ -83,6 +83,12 @@
return LM_RET_ERR;
}

// 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

}

ret = write(fd, cmd, size);
CHK_GOTO_TAG((ret <= 0), RET);

Expand Down
Loading