Skip to content

ListArray::from(ArrayData) dereferences invalid pointer when offsets are empty #1601

@jhorstmann

Description

@jhorstmann

Describe the bug

ListArray::from(ArrayData) tries to validate that the first offset is zero, without checking that the offset buffer actually contains any data. This leads to a segmentation fault when creating an empty ListArray.

Additionally this validation should not really be needed, starting from a non-zero offset should work fine.

To Reproduce
Create an ArrayData object with list type and an empty offset buffer.

Expected behavior
The ListArray creation should succeed, resulting in an empty array.

Additional context
Related to #1545 since validation already happened when creating the ArrayData struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow cratebug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions