Skip to content

RDKB-64598 : Coverity issues in ccsp-moca component#33

Merged
GoutamD2905 merged 1 commit intodevelopfrom
feature/RDKB-64598-coverity-check-fix
May 4, 2026
Merged

RDKB-64598 : Coverity issues in ccsp-moca component#33
GoutamD2905 merged 1 commit intodevelopfrom
feature/RDKB-64598-coverity-check-fix

Conversation

@SuneethaLakshmi
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 4, 2026 08:30
@SuneethaLakshmi SuneethaLakshmi requested review from a team as code owners May 4, 2026 08:30
Copy link
Copy Markdown
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 addresses multiple Coverity findings in the ccsp-moca component by tightening pointer validation and preventing potential string/buffer overruns when interacting with MoCA HAL structures and parsing /proc/net/arp.

Changes:

  • Add parameter NULL validation in CosaDmlMocaIfReset() to prevent dereference warnings.
  • Ensure MoCA HAL fields are explicitly NUL-terminated before HAL calls (including NodeTabooMask).
  • Fix potential ARP parsing buffer overruns in MRD by resizing buffers and tightening fscanf field widths.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
source/TR-181/board_sbapi/cosa_moca_webconfig_api.c Adds explicit NodeTabooMask termination before updating HAL during rollback.
source/TR-181/board_sbapi/cosa_moca_apis.c Adds NULL validation for MCfg and adds NodeTabooMask termination in multiple HAL interaction paths.
source/MRD/mrd.c Prevents out-of-bounds writes by increasing ipAddr buffer and limiting MAC field width in ARP parsing.

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

Comment on lines +573 to +577
/* Coverity CID 414230: STRING_NULL — validate all pointer params before any dereference */
if ( !MCfg )
{
CcspTraceWarning(("CosaDmlMocaIfReset -- MCfg is NULL\n"));
return ANSC_STATUS_FAILURE;
@GoutamD2905 GoutamD2905 merged commit 10583d8 into develop May 4, 2026
13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants