Repository navigation
GH-55400: [C++][IPC] Validate ReadMessage body_length - #55382
Open
professor-moody wants to merge 1 commit into
Open
professor-moody wants to merge 1 commit into
professor-moody wants to merge 1 commit into
Conversation
|
Thanks for opening a pull request! This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format. If this is not a minor PR, could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or After updating the title, you can mark the pull request as ready for review. See also: |
professor-moody
marked this pull request as ready for review
November 3, 2026 21:38
raulcd
requested changes
Nov 4, 2026
raulcd
left a comment
Member
There was a problem hiding this comment.
This is not a minor. Please open an issue and read how to contribute and our AI guidelines.
Author
Reject negative body lengths and metadata-plus-body length overflow before the public readers perform IO. Preserve upstream file-size and field-loading checks when rebasing the existing change onto current main.
professor-moody
force-pushed
the
fix-ipc-readmessage-body-length
branch
from
November 18, 2026 13:21
1a11d1f to
b2bfaa7
Compare
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.
Rationale for this change
The public IPC message readers need to reject invalid body lengths before arithmetic or IO. This addresses #55400.
What changes are included in this PR?
In
cpp/src/arrow/ipc/message.cc,ReadMessageInternalandReadMessageAsyncreturnInvalidfor negative body lengths or a metadata-plus-body length that exceeds the signed 64-bit range. The rebase preserves the newer upstream file-size and field-loading checks. The synchronous guard runs beforeCheckBodyLength.Are these changes tested?
ReadMessageValidBodyLengthandReadMessageInvalidBodyLengthincpp/src/arrow/ipc/message_internal_test.cccover valid reads and rejection in both reader APIs.Are there any user-facing changes?
Invalid body lengths return
Invalid. Valid calls retain the existing behavior. No public API signature changes.Was AI used for this PR?
The existing human-authored contribution used AI assistance. AI assisted this rebase, source review and validation.
PR code and description written by:
Reviewed before submission by:
How was this patch generated?
AI assistance reapplied the existing guards and tests to current main and retained the upstream checks.
AI assistance was used in drafting and validating this change; the patch and tests were reviewed and verified by the author.