Skip to content

fix(array): validate MakeFromData type IDs#904

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:pr/fix-makefromdata-typeid-bounds
Open

fix(array): validate MakeFromData type IDs#904
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:pr/fix-makefromdata-typeid-bounds

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fail fast on invalid Arrow type IDs in array.MakeFromData instead of masking and dispatching into the wrong constructor slot.

Why this fix

MakeFromData currently masks the type ID (& 0x3f) before table lookup. New or invalid IDs can wrap to valid indices, causing wrong constructors or nil dispatch and a confusing panic.

Changes

  • Convert ID to int and validate it explicitly.
  • Reject IDs that are:
    • less than zero
    • greater/equal to len(makeArrayFn)
    • mapped to nil constructors
  • Keep existing invalidDataType(...) panic path for unsupported IDs.

Files

  • arrow/array/array.go
  • arrow/array/array_test.go

Validation

  • Added TestMakeFromData case for invalid type 64 and assertion of panic text.

Bug details

  • Severity: 88/100
  • Ask product?: 0/100

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