RDKB-64598 : Coverity issues in ccsp-moca component#32
Closed
SuneethaLakshmi wants to merge 1 commit intodevelopfrom
Closed
RDKB-64598 : Coverity issues in ccsp-moca component#32SuneethaLakshmi wants to merge 1 commit intodevelopfrom
SuneethaLakshmi wants to merge 1 commit intodevelopfrom
Conversation
Signed-off-by: SuneethaLakshmi <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses static analysis (Coverity) findings in the ccsp-moca component and MRD by tightening pointer validation and preventing buffer overruns/unterminated string handling in a few MoCA and ARP-parsing code paths.
Changes:
- Add a NULL check for
MCfginCosaDmlMocaIfReset()before dereferencing it. - Add/extend “string termination” handling for selected MoCA HAL fields prior to
moca_SetIfConfig()calls. - Fix
/proc/net/arpparsing to avoid overflowing the MAC address buffer by reducing the%sscan width and resizing the temporary IP buffer.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| source/TR-181/board_sbapi/cosa_moca_webconfig_api.c | Adds additional termination logic before rollback moca_SetIfConfig() call. |
| source/TR-181/board_sbapi/cosa_moca_apis.c | Adds MCfg NULL guard and additional termination logic around MoCA config sync/reset paths. |
| source/MRD/mrd.c | Fixes ARP cache parsing format/temporary buffers to prevent overruns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+308
to
+309
| /* Coverity CID 348464: STRING_NULL — ensure HAL string fields are terminated */ | ||
| mocaCfg.NodeTabooMask[sizeof(mocaCfg.NodeTabooMask) - 1] = 0; |
| mocaCfg.Alias[sizeof(mocaCfg.Alias) - 1] = '\0'; | ||
| mocaCfg.KeyPassphrase[sizeof(mocaCfg.KeyPassphrase) - 1] = '\0'; | ||
|
|
||
| mocaCfg.NodeTabooMask[sizeof(mocaCfg.NodeTabooMask) - 1] = 0; |
Comment on lines
+1090
to
+1091
| /* CID 348463 coverity fix for string null error */ | ||
| mocaCfg.NodeTabooMask[sizeof(mocaCfg.NodeTabooMask) - 1] = 0; |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.