← Back to Pull requests

GH-55400: [C++][IPC] Validate ReadMessage body_length #55382

Open
unknown opened this pull request with 177 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 03, 2026 20:45 UTC
Author

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, ReadMessageInternal and ReadMessageAsync return Invalid for 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 before CheckBodyLength.

Are these changes tested?

ReadMessageValidBodyLength and ReadMessageInvalidBodyLength in cpp/src/arrow/ipc/message_internal_test.cc cover 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:

  • Human

  • AI
  • Reviewed before submission by:

  • Human

  • AI
  • 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.

  • GitHub Issue: #55400
  • Diff: 177 lines (+132 / -45) across 2 files Reviewer: raulcd Review duration: 38728m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.35) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 177 lines diff across 2 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.310
    Real PR Conversation Timeline
    1 comments
    "Review active on #55382"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.4% (MEDIUM) · Higher = larger blast radius
    35.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.9% · Safe to merge
    18.9%
    Repository