Skip to content

fix(orc): validate string offsets before deep copying - #591

Open
lszskye wants to merge 1 commit into
apache:mainfrom
lszskye:codex/orc-large-string-read
Open

lszskye wants to merge 1 commit into
apache:mainfrom
lszskye:codex/orc-large-string-read

Conversation

@lszskye

@lszskye lszskye commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Purpose

The ORC string deep-copy path copies decoded data before checking
the 32-bit offset limit. When cumulative string lengths exceed
INT32_MAX, the destination offset can become invalid and subsequent
copies can cause SIGSEGV before the existing bounds check runs.

Prepare and validate offsets before allocating or copying string
data, so oversized batches return an Invalid status.

Tests

  • Add a unit test with 2048 rows sharing a 1 MiB string. Verify that
    conversion rejects the oversized batch without allocating through
    the Arrow memory pool.
  • Add an integration test that writes dictionary-encoded ORC data
    and reads it with lazy decoding disabled, using the default memory
    pool. Verify that a 2048-row batch returns the bounds error and
    8-row batches read all values correctly with valid Arrow arrays.

API and Format

No public API, storage format, or protocol changes.

Documentation

No documentation changes are needed for this bug fix.

Generative AI tooling

Generated-by: OpenAI Codex CLI 0.155.1

@zjw1111 zjw1111 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1

This branch has not been deployed

No deployments
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.

3 participants