Skip to content

SWRDKV-5382: NTS cases fix.#204

Open
jianwang-brcm wants to merge 1 commit into
rdkcentral:mainfrom
jianwang-brcm:feature/SWRDKV-5382
Open

SWRDKV-5382: NTS cases fix.#204
jianwang-brcm wants to merge 1 commit into
rdkcentral:mainfrom
jianwang-brcm:feature/SWRDKV-5382

Conversation

@jianwang-brcm

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings June 9, 2026 21:53
@jianwang-brcm jianwang-brcm requested a review from a team as a code owner June 9, 2026 21:53

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR hardens DIAL POST payload handling to be length-aware (avoiding reliance on NUL-termination) and prevents a possible NULL dereference when comparing client DIAL versions.

Changes:

  • Use msg->request_body->length + g_strndup() for safe payload handling, and add a special-case for Netflix similar to YouTube.
  • Ensure temporary payload buffers are freed after URI encoding.
  • Guard compare_versions() against client_dial_version == NULL.

Reviewed changes

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

File Description
server/gdial-rest.c Makes POST payload handling length-based and adds Netflix handling; adjusts encoding path to copy bounded input.
server/gdial-app.c Adds a NULL check before version comparison to avoid dereferencing a NULL client version string.

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

Comment thread server/gdial-rest.c
Comment on lines +486 to +491
gchar *tmp_payload = g_strndup(payload, msg->request_body->length);
char *tmp = soup_uri_encode(tmp_payload, "=&");
// note that we later g_free(payload_safe) which doesn't necessarily work with malloc'ed memory (seems to depend on glib version)
payload_safe = g_strdup(tmp);
free(tmp);
g_free(tmp_payload);
Comment thread server/gdial-rest.c
Comment on lines +481 to 484
if (g_str_has_prefix(app->name, "YouTube") || g_str_has_prefix(app->name, "Netflix")) {
/* temporary disabling encoding payload for YouTube till cloud side changed*/
payload_safe = g_strdup(payload);
payload_safe = g_strndup(payload, msg->request_body->length);
}
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