Skip to content

RDKB-64347: Fixing coverity issues#1221

Open
bharathivelp wants to merge 1 commit into
rdkcentral:developfrom
bharathivelp:rdkb_low
Open

RDKB-64347: Fixing coverity issues#1221
bharathivelp wants to merge 1 commit into
rdkcentral:developfrom
bharathivelp:rdkb_low

Conversation

@bharathivelp

Copy link
Copy Markdown
Contributor

Reason for change: Fixing Low priority Coverity issues.
Test Procedure: Build should be successful and the regression test should also succeed.
 
Risks: Low
Priority: P1
Signed-off-by: Velpula_Bharathi@comcast.com

Reason for change: Fixing Low priority Coverity issues.
Test Procedure: Build should be successful and the regression test should also succeed.
 
Risks: Low
Priority: P1
Signed-off-by: Velpula_Bharathi@comcast.com
Copilot AI review requested due to automatic review settings June 23, 2026 06:51
@bharathivelp bharathivelp requested a review from a team as a code owner June 23, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 low-priority Coverity findings by tightening string/buffer handling in WiFi TR-181/DML and WiFi DB code paths to reduce overflow/truncation risks.

Changes:

  • Extend getSecurityStringFromInt() to accept an explicit destination buffer size and switch to snprintf()-based writes.
  • Update TR-181 ModeEnabled getter to call the new getSecurityStringFromInt() signature.
  • Harden last_reboot_reason retrieval by adding length-aware APIs and ensuring NUL-termination when copying bus/PSM values.

Reviewed changes

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

File Description
source/dml/tr_181/sbapi/cosa_wifi_apis.c Adds buffer-size parameter and safer append/copy logic for security-mode string conversion.
source/dml/tr_181/ml/cosa_wifi_dml.c Updates caller to pass buffer size for security-mode conversion.
source/db/wifi_db_apis.c Makes last-reboot-reason retrieval length-aware and improves safe copying / error handling.

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

Comment on lines +450 to +454
currentLen = AnscSizeOfString(securityName);
if (currentLen != 0)
{
strcat(securityName, ",");
strcat(securityName, wifiSecMap[i].wifiSecType);
if (currentLen >= bufSize)
{
Comment thread source/dml/tr_181/sbapi/cosa_wifi_apis.c
Comment thread source/dml/tr_181/ml/cosa_wifi_dml.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants