Skip to content

DeltaByteArrayDecoder panics on invalid prefix lengths #9796

Closed

Description

@pchintar

Problem

DeltaByteArrayDecoder::get assumes decoded prefix lengths are always valid and directly slices:

self.previous_value[0..prefix_len]

If the decoded prefix_len is negative (after decoding) or larger than
previous_value.len(), this results in a slice bounds panic.

Expected Behavior

The decoder should return Err on invalid input instead of panicking.

Actual Behavior

Invalid prefix lengths can cause a panic such as:

range end index X out of range for slice of length Y

Reproduction

This can be reproduced by:

  • encoding valid DELTA_BYTE_ARRAY data
  • modifying the prefix-length stream (DELTA_BINARY_PACKED)
  • decoding using DeltaByteArrayDecoder::get

This leads to a panic instead of returning an error.

Notes

  • There is currently no validation for:
    • negative prefix lengths
    • prefix lengths exceeding previous_value.len()
  • Other decoders (e.g., DELTA_BINARY_PACKED) perform validation on decoded values,
    but this check is missing here.

Impact

This can cause unexpected panics when reading invalid or unexpected encoded data,
instead of returning a controlled error.

Activity

  1. changed the title [-]DELTA_BYTE_ARRAY decoder panics on invalid prefix lengths[/-] [+]DeltaByteArrayDecoder panics on invalid prefix lengths[/+] on Apr 23, 2026
  2. added a commit that references this issue on Apr 24, 2026
    c09945f
  3. added
    parquet
    on Apr 28, 2026
  4. alamb commented on Apr 28, 2026

    @alamb
    Contributor

    label_issue.py automatically added labels {'parquet'} from #9797

  5. added a commit that references this issue on Jun 2, 2026
    876f156
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    parquet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions