CMFSUPPORT-3907 : COVERITY TEST. DO NOT MERGE#26
Conversation
There was a problem hiding this comment.
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
CcspMoCAConsoleTracelog line insideSet_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)); |
There was a problem hiding this comment.
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.
| 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)); |
| 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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Coverity Issue - Printf arg count mismatch
the format string requires additional arguments
Medium Impact, CWE-685
PW.TOO_FEW_PRINTF_ARGS
|
Close test PR |
DO NOT MERGE