Skip to content

CMFSUPPORT-3907 : COVERITY TEST. DO NOT MERGE#26

Closed
snampo768 wants to merge 3 commits intodevelopfrom
feature/test-workflow
Closed

CMFSUPPORT-3907 : COVERITY TEST. DO NOT MERGE#26
snampo768 wants to merge 3 commits intodevelopfrom
feature/test-workflow

Conversation

@snampo768
Copy link

DO NOT MERGE

Copilot AI review requested due to automatic review settings February 25, 2026 12:25
@snampo768 snampo768 requested review from a team as code owners February 25, 2026 12:25
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 be a temporary change for a Coverity test (explicitly marked “DO NOT MERGE”) within the TR-181 MoCA middle-layer logging path.

Changes:

  • Modified a CcspMoCAConsoleTrace log line inside Set_MoCADevices_Status_Offline().

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

while(cur != NULL)
{
CcspMoCAConsoleTrace(("RDK_LOG_DEBUG, CcspMoCA %s cur->Status %d \n", __FUNCTION__ , cur->Status));
CcspMoCAConsoleTrace(("RDK_LOG_DEBUG, CcspMoCA %s cur->Status %d \n" , cur->Status));
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The trace call’s format string expects both a %s (function name) and a %d (status), but only provides a single argument (cur->Status). This can lead to undefined behavior and possible crashes. Pass FUNCTION (or remove the %s) and ensure the argument list matches the format specifiers.

Suggested change
CcspMoCAConsoleTrace(("RDK_LOG_DEBUG, CcspMoCA %s cur->Status %d \n" , cur->Status));
CcspMoCAConsoleTrace(("RDK_LOG_DEBUG, CcspMoCA %s cur->Status %d \n", __FUNCTION__ , cur->Status));

Copilot uses AI. Check for mistakes.
ERR_CHK(rc);
get_formatted_time(tmp);
snprintf(buff, 2256, "%s MOCA_MAC_%lu:%s\n", tmp, ulIndex+1 , mac_buff1);
snprintf(buff, 2256, "%s MOCA_MAC_%lu:%s%s\n", tmp, ulIndex+1 , mac_buff1);
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 - Missing argument to printf format specifier

No argument for format specifier "%s".

Medium Impact, CWE-685
PRINTF_ARGS

ERR_CHK(rc);
get_formatted_time(tmp);
snprintf(buff, 2256, "%s MOCA_MAC_%lu:%s\n", tmp, ulIndex+1 , mac_buff1);
snprintf(buff, 2256, "%s MOCA_MAC_%lu:%s%s\n", tmp, ulIndex+1 , mac_buff1);
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 - Printf arg count mismatch

the format string requires additional arguments

Medium Impact, CWE-685
PW.TOO_FEW_PRINTF_ARGS

@snampo768
Copy link
Author

Close test PR

@snampo768 snampo768 closed this Feb 25, 2026
@snampo768 snampo768 deleted the feature/test-workflow branch February 25, 2026 13:34
@github-actions github-actions bot locked and limited conversation to collaborators Feb 25, 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