Skip to content

[59_maintenance] fix: use correct length in runarray validation - #11740

Merged
alamb merged 1 commit into
apache:59_maintenancefrom
alamb:backport_11668
Oct 20, 2026
Merged

alamb merged 1 commit into
apache:59_maintenancefrom
alamb:backport_11668

Conversation

@alamb

@alamb alamb commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of a9455d4

Note: the cherry-pick conflicted, so the change was applied by hand. The 59 line does not have the child_at / non-integer run end type error refactor, so this keeps the existing child_data()[0] / unreachable!() code, and the tests use literal "run_ends" / "values" field names because Field::REE_*_FIELD_DEFAULT_NAME constants are not on the 59 line.

<!--
It is not necessary to raise an issue, but it is encouraged if it is a
non-trivial
enhancement/bug.

If this PR relates to an existing issue, but does not fully resolve it,
please change
the wording below from "Closes #NNN" to "Relates to #NNN" or "Part of
false closing an issue.
-->

- Closes apache#11587

<!--
Why are you proposing this change? If this is already explained clearly
in the
issue then this section is not needed. Explaining clearly why changes
are proposed
helps reviewers understand your changes and offer better suggestions for
fixes.

Please try to explain the problem you are trying to solve in terms of
the user-visible
behavior, rather than the implementation.
-->

Fix incorrect validation of run arrays

<!--
There is no need to duplicate the description in the issue here but it
is
sometimes worth providing a summary of the individual changes in this
PR.
-->

Use correct parent logical length when validating run values

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they
covered by existing tests, if so identify these tests)?

If this PR claims a performance improvement, please include evidence
such as
benchmark results.

DO NOT simply paste a list of commands ran to verify the code; this is
what our
CI is for and it pollutes the PR. ONLY explain if testing was included
with this
PR, or why it wasn't.
-->

Yes

<!--
Significant user-facing changes include:
- Breaking public API change
- Significant change to existing functionality (e.g. function returns
something different)

These need to be explicitly called out to ensure we have proper
documentation if
required and to ensure we follow proper semantic versioning.

DO NOT restate the changes of this PR; if a bug was fixed and already
explained
above, we don't need this to be restated as a user-facing change.
-->

No

---------

Co-authored-by: Andrew Lamb <[email protected]>
@github-actions github-actions Bot added the arrow-core Core crates related to representing arrow data label Oct 20, 2026
@alamb
alamb merged commit 7de162b into apache:59_maintenance Oct 20, 2026
31 checks passed
@alamb

alamb commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @Rich-T-kid

@Jefffrey Jefffrey added the bug Squash those bugs label Oct 21, 2026
lukekim added a commit to spiceai/arrow-rs that referenced this pull request Nov 5, 2026
Backport of apache#11668 / apache#11740 (RUSTSEC-2026-0442 /
CVE-2026-111959). check_run_ends previously compared the last run end
against the run-ends child's length (number of runs), so a RunEndEncoded
array whose logical offset+len past the last run end still validated.
Reading those rows indexed past the values child.

Pass the parent ArrayData's len and offset+len into check_run_ends, and
reject when parent_len > 0 and the last run end is short of that bound.
Includes the upstream regression tests.
lukekim added a commit to spiceai/arrow-rs that referenced this pull request Nov 5, 2026
Backport of apache#11668 / apache#11740 (RUSTSEC-2026-0442 /
CVE-2026-111959). check_run_ends previously compared the last run end
against the run-ends child's length (number of runs), so a RunEndEncoded
array whose logical offset+len past the last run end still validated.
Reading those rows indexed past the values child.

Pass the parent ArrayData's len and offset+len into check_run_ends, and
reject when parent_len > 0 and the last run end is short of that bound.
Includes the upstream regression tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data bug Squash those bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants