RDKB-65853: Fixing coverity issue - #1253
Conversation
There was a problem hiding this comment.
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
whereclause 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.
There was a problem hiding this comment.
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");
65ae2e1 to
a6fd636
Compare
There was a problem hiding this comment.
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
wherepassed intoonewifi_ovsdb_table_update_where(). Clearingwhereafter 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");
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
There was a problem hiding this comment.
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 viaconnected_subdoc_handler(...)(beforexfinity_blobis 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);
|
@navyasher hi, have you run this through jenkins ? |
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