Skip to content

RDKB-64641 Fix double-free in multipart POST fallback path#27

Open
pavankumar464 wants to merge 1 commit into
developfrom
bug/RDKB-64641
Open

RDKB-64641 Fix double-free in multipart POST fallback path#27
pavankumar464 wants to merge 1 commit into
developfrom
bug/RDKB-64641

Conversation

@pavankumar464

Copy link
Copy Markdown
Contributor
  • In process_multipart_form_data, replace post_data = content_data with post_data = strdup(content_data) when there are no non-file fields.
  • content_data is freed by caller (ccsp_post_module_open), so aliasing caused double-free/heap corruption.
  • Prevents crash pattern seen as SIGSEGV/SIGABRT in core dumps.

- In process_multipart_form_data, replace post_data = content_data with post_data = strdup(content_data) when there are no non-file fields.

- content_data is freed by caller (ccsp_post_module_open), so aliasing caused double-free/heap corruption.

- Prevents crash pattern seen as SIGSEGV/SIGABRT in core dumps.
@pavankumar464 pavankumar464 requested a review from a team as a code owner July 9, 2026 03:00
Copilot AI review requested due to automatic review settings July 9, 2026 03:00

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 double-free/heap corruption in the multipart POST parsing fallback path by ensuring post_data does not alias content_data (which is freed by ccsp_post_module_open after parsing).

Changes:

  • In process_multipart_form_data, replace post_data = content_data with post_data = strdup(content_data) when there are no non-file fields.
  • Add an allocation failure log for the strdup call and document the ownership rationale inline.

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

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