Skip to content

fix(parquet/encoding): reject invalid delta byte prefixes#1014

Open
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/parquet-delta-prefix-validation
Open

fix(parquet/encoding): reject invalid delta byte prefixes#1014
fallintoplace wants to merge 2 commits into
apache:mainfrom
fallintoplace:fix/parquet-delta-prefix-validation

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Rationale for this change

DELTA_BYTE_ARRAY prefix lengths are used directly as slice bounds. Negative prefixes or prefixes longer than the previous value therefore panic. The decoder also retains its previous value when reused for a new page, even though each page starts an independent delta sequence.

What changes are included in this PR?

  • Reset the previous value in SetData.
  • Propagate prefix stream decode errors and short reads.
  • Require the first prefix to be zero and validate later prefixes before slicing.
  • Apply the same validation to decode and discard paths.

Are these changes tested?

Yes. Focused tests cover decoder reuse, negative prefixes, and prefixes longer than the previous value.

@fallintoplace
fallintoplace requested a review from zeroshade as a code owner July 25, 2026 16:07
@fallintoplace
fallintoplace force-pushed the fix/parquet-delta-prefix-validation branch from 7d3de32 to bf7624b Compare July 25, 2026 16:12
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.

1 participant