Skip to content

RDKEMW-22210: Fix coverity issues on xdial - #211

Open
balav08 wants to merge 1 commit into
developfrom
feature/RDKEMW-22210
Open

RDKEMW-22210: Fix coverity issues on xdial#211
balav08 wants to merge 1 commit into
developfrom
feature/RDKEMW-22210

Conversation

@balav08

@balav08 balav08 commented Jul 23, 2026

Copy link
Copy Markdown

Reason for change: Fixing coverity reported issues.
Test Procedure: Refer ticket.
Risks: Low
Priority: P1
version: minor

Reason for change: Fixing coverity reported issues.
Test Procedure: Refer ticket.
Risks: Low
Priority: P1
version: minor

Signed-off-by: balaji velmurugan <balaji_velmurugan@comcast.com>
Copilot AI review requested due to automatic review settings July 23, 2026 10:38
@balav08
balav08 requested a review from a team as a code owner July 23, 2026 10:38

Copilot AI left a comment

Copy link
Copy Markdown

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 targets Coverity-reported issues in the xdial server implementation, primarily by adding NULL checks and tightening memory/resource handling in the REST and SSDP paths.

Changes:

  • Add NULL-guarding around request payload logging and additional-data URL escaping in the libsoup 3.0 REST POST handler.
  • Free an allocated handler path string in the libsoup 2.4 SSDP initialization path to address a resource leak.
  • Add a NULL check around gdial_app_state_to_string() usage when building the app state XML response.

Reviewed changes

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

File Description
server/libsoup/3.0/gdial-rest.c Adds Coverity-driven NULL checks and adjusts string initialization in response builder logic.
server/libsoup/2.4/gdial-ssdp.c Frees dail_ssdp_handler after handler registration to address a reported leak.
server/gdial-app.c Guards against NULL state string when creating the <state> XML node.

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

Comment on lines +436 to +438
// coverity fix : FORWARD_NULL - check for NULL request_body->data before using in log
const char *payload_str = (request_body && request_body->data) ? request_body->data : "";
GDIAL_LOGERROR("Starting the app with payload %.*s", (int)request_body->length, payload_str);
Comment on lines +503 to +504
if (additional_data_url_safe) free(additional_data_url_safe);
if (additional_data_url) g_free(additional_data_url);
Comment thread server/gdial-app.c
Comment on lines +532 to +534
// coverity fix : USE_AFTER_FREE - check for NULL before using state_str
const gchar *state_str = gdial_app_state_to_string(state);
if (state_str) {
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