RDKB-64641 Fix double-free in multipart POST fallback path#27
Open
pavankumar464 wants to merge 1 commit into
Open
RDKB-64641 Fix double-free in multipart POST fallback path#27pavankumar464 wants to merge 1 commit into
pavankumar464 wants to merge 1 commit into
Conversation
pavankumar464
commented
Jul 9, 2026
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.
There was a problem hiding this comment.
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, replacepost_data = content_datawithpost_data = strdup(content_data)when there are no non-file fields. - Add an allocation failure log for the
strdupcall and document the ownership rationale inline.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.