Skip to content

RDKB-64347: Fixing coverity issues#1218

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

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

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:47
@bharathivelp bharathivelp requested a review from a team as a code owner June 23, 2026 06:47

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 hardening memory and string handling in utility and Wi-Fi control paths.

Changes:

  • Add realloc failure handling when appending to the global ovsh_where_expr list.
  • Prevent assoc_maclist buffer overflows when concatenating MAC strings in kick/ACL flows.
  • Replace strcpy() with bounded writes (snprintf) when building debug strings in 802.1x processing.

Reviewed changes

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

File Description
source/utils/ovsh.c Adds realloc() failure handling when growing the ovsh_where_expr array.
source/core/wifi_ctrl_queue_handlers.c Introduces a shared buffer-size constant and bounds-checks concatenation into assoc_maclist.
source/core/wifi_8021x.c Replaces strcpy() calls with bounded string writes for debug fields.

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

Comment thread source/utils/ovsh.c
Comment on lines +1277 to 1279
ovsh_where_expr = tmp;
ovsh_where_expr[ovsh_where_num-1] = strdup(_str);
}
Comment on lines +1433 to +1442
if (current_len + strlen(mac_str) + 2 <= MAX_MACLIST_BUFFER_SIZE) {
strncat(assoc_maclist, mac_str, MAX_MACLIST_BUFFER_SIZE - current_len - 1);
strncat(assoc_maclist, ",", MAX_MACLIST_BUFFER_SIZE - strlen(assoc_maclist) - 1);
has_successful_operations = true;
} else {
wifi_util_error_print(WIFI_CTRL, "%s:%d assoc_maclist buffer overflow avoided, undoing ACL operation for %s\n", __func__, __LINE__, mac_str);
if (handle_acl_operation(vap_index, mac_str, vap_info, rdk_vap_info, false) != RETURN_OK) {
wifi_util_error_print(WIFI_CTRL, "%s:%d Failed to undo ACL operation after assoc_maclist overflow for %s\n", __func__, __LINE__, mac_str);
}
}
Comment thread source/core/wifi_8021x.c
Comment on lines +133 to +137
snprintf(msg, sizeof(msg), "%s", "response");
} else if (eap->code == wifi_eap_code_success) {
strcpy(msg, "success");
snprintf(msg, sizeof(msg), "%s", "success");
} else if (eap->code == wifi_eap_code_failure) {
strcpy(msg, "failure");
snprintf(msg, sizeof(msg), "%s", "failure");
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