Skip to content

RDKB-65853: Fixing coverity issue - #1253

Open
navyasher wants to merge 1 commit into
rdkcentral:developfrom
navyasher:Manish_cov1
Open

RDKB-65853: Fixing coverity issue#1253
navyasher wants to merge 1 commit into
rdkcentral:developfrom
navyasher:Manish_cov1

Conversation

@navyasher

Copy link
Copy Markdown
Contributor

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

Copilot AI review requested due to automatic review settings July 8, 2026 10:25
@navyasher
navyasher requested a review from a team as a code owner July 8, 2026 10:25

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 Coverity-reported issues primarily around resource management (cJSON/Jansson objects and heap allocations) in the webconfig encoding and multicomp subdoc processing paths.

Changes:

  • Removes redundant/unsafe cJSON object handling in radio channel encoding.
  • Adjusts OVSDB where clause lifetime management in Ignite config update flow.
  • Adds missing frees/deletes in multicomp webconfig handlers (cJSON_Print buffer, parsed root, detached sub-blobs, msgpack resources).

Reviewed changes

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

File Description
source/webconfig/wifi_encoder.c Removes an unused cJSON object creation and avoids deleting a NULL object on allocation failure.
source/db/wifi_db_apis.c Removes json_decref(where) calls (consistent with ownership transfer in the OVSDB transaction builder).
source/core/wifi_multidoc_webconfig.c Adds missing cleanup for cJSON_Print output, parsed roots, detached sub-blobs, and msgpack buffers/zones on success paths.

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

Comment thread source/core/wifi_multidoc_webconfig.c Outdated
Copilot AI review requested due to automatic review settings July 10, 2026 07:19

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread source/core/wifi_multidoc_webconfig.c
Copilot AI review requested due to automatic review settings July 14, 2026 12:12

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 20, 2026 12:44

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

source/core/wifi_multidoc_webconfig.c:2087

  • Typo in log message: "successfuly" should be "successfully" (and remove the extra space before the newline escape).
    wifi_util_info_print(WIFI_CTRL,"Managed guest blob is applied successfuly \n");

Comment thread source/core/wifi_multidoc_webconfig.c
@navyasher
navyasher force-pushed the Manish_cov1 branch 4 times, most recently from 65ae2e1 to a6fd636 Compare July 23, 2026 10:57
Copilot AI review requested due to automatic review settings July 23, 2026 10:57

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 27, 2026 07:32

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

source/db/wifi_db_apis.c:3334

  • Same ownership transfer applies to where passed into onewifi_ovsdb_table_update_where(). Clearing where after the call helps avoid accidental use of a pointer that the OVSDB transaction now owns.
        ret = onewifi_ovsdb_table_update_where(g_wifidb->wifidb_sock_path,
                &table_Wifi_Ignite_Config,
                where, &cfg);

        if (ret <= 0) {

source/core/wifi_multidoc_webconfig.c:2093

  • Typo in log message: "successfuly" should be "successfully" (and the extra space before the newline can be removed).
    wifi_util_info_print(WIFI_CTRL,"Managed guest blob is applied successfuly \n");

Comment thread source/db/wifi_db_apis.c
Reason for change: Fixing coverity issues.
Test Procedure: Build should be successful and the regression test should also succeed
Risks: Low
Priority: P1
Signed-off-by: Navya_Sheregar@comcast.com
Copilot AI review requested due to automatic review settings July 27, 2026 09:24

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

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

Comments suppressed due to low confidence (2)

source/core/wifi_multidoc_webconfig.c:2057

  • The error log here refers to detaching xfinity_blob, but this failure occurs while processing the Amenities/WifiVapConfig blob via connected_subdoc_handler(...) (before xfinity_blob is detached). This makes debugging misleading; update the message to match the actual failing operation.
        cJSON_Delete(amenities_blob);
        cJSON_Delete(vap_blob);
        cJSON_Delete(root);
        wifi_util_error_print(WIFI_CTRL, "%s: Failed to detach xfinity_blob\n", __func__);

source/core/wifi_multidoc_webconfig.c:2094

  • Typo in log message: "successfuly" should be "successfully".
    wifi_util_info_print(WIFI_CTRL,"Managed guest blob is applied successfuly \n");
    cJSON_Delete(amenities_blob);

@mateuszCieslak-GL

Copy link
Copy Markdown
Contributor

@navyasher hi, have you run this through jenkins ?

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.

3 participants