Skip to content

RDKB-60813 : jst crash fix#8

Open
Nithishkumar-T wants to merge 2 commits into
developfrom
feature/issue-7
Open

RDKB-60813 : jst crash fix#8
Nithishkumar-T wants to merge 2 commits into
developfrom
feature/issue-7

Conversation

@Nithishkumar-T

Copy link
Copy Markdown

Reason for change: jst crash fix
Test Procedure: As per ticket
Risks: Medium
Priority: P0
Signed-off-by: Harnish_Patel@comcast.com

Change-Id: I109a372871f9fb28c763d5923e334c440c3c10dd (cherry picked from commit 3a5406eb14d164ee2ea14ed1ab70a76019e00ec7)

Reason for change: jst crash fix
Test Procedure: As per ticket
Risks: Medium
Priority: P0
Signed-off-by: Harnish_Patel@comcast.com

Change-Id: I109a372871f9fb28c763d5923e334c440c3c10dd
(cherry picked from commit 3a5406eb14d164ee2ea14ed1ab70a76019e00ec7)
@Nithishkumar-T Nithishkumar-T requested a review from a team as a code owner September 29, 2025 09:30
@Nithishkumar-T Nithishkumar-T self-assigned this Sep 29, 2025
@Nithishkumar-T Nithishkumar-T linked an issue Sep 29, 2025 that may be closed by this pull request
Copilot AI review requested due to automatic review settings April 24, 2026 13:04

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

Fixes a crash in JST POST handling by adjusting memory ownership for multipart/form-data requests in ccsp_post_module_open, avoiding freeing the POST buffer when it is retained for later retrieval.

Changes:

  • Conditionally free content_data after multipart parsing to avoid freeing memory that post_data points to (prevents double-free/use-after-free crash).

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

Comment thread source/jst_post.c
Comment on lines +965 to +967
if (post_data == NULL || post_data != content_data) {
free(content_data);
}

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new if block uses tab indentation and a brace/indent style that doesn’t match the surrounding file (which appears to use consistent 2-space indentation). Please reformat these lines to match local style for readability and diff hygiene.

Suggested change
if (post_data == NULL || post_data != content_data) {
free(content_data);
}
if (post_data == NULL || post_data != content_data) {
free(content_data);
}

Copilot uses AI. Check for mistakes.
Comment thread source/jst_post.c
Comment on lines +965 to +967
if (post_data == NULL || post_data != content_data) {
free(content_data);
}

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (post_data == NULL || post_data != content_data) is logically equivalent to post_data != content_data here because content_data is non-NULL on this path. Simplifying the condition would improve readability and reduce redundant checks.

Suggested change
if (post_data == NULL || post_data != content_data) {
free(content_data);
}
if (post_data != content_data) {
free(content_data);
}

Copilot uses AI. Check for mistakes.
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.

Task: cherrypick gerrit change 926668

4 participants