Skip to content

fix(cdata): validate imported array sizes#931

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/cdata-array-header-validation
Open

fix(cdata): validate imported array sizes#931
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:fix/cdata-array-header-validation

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

The C array importer now validates all header counts and pointer arrays before creating native slices.

It also checks native-int conversion, length/offset arithmetic, bitmap and physical buffer sizes, binary-view size metadata, dictionary presence, and expected child/buffer counts before traversal. Invalid metadata returns an error instead of reaching unsafe buffer construction.

Tests cover negative and oversized headers, missing pointer arrays, root preflight before ownership transfer, and fixed-width/offset multiplication overflow paths.

Validation:

  • go test -tags test ./arrow/cdata -count=1
  • go test ./arrow/cdata -count=1
  • pre-commit run golangci-lint-full --all-files
  • git diff --check

The full arrow test suite is otherwise blocked by missing repository fixtures under parquet-testing/data and arrow-testing/data/csv. Linux/386 cgo compilation is unavailable on this macOS host.

@fallintoplace fallintoplace requested a review from zeroshade as a code owner July 11, 2026 22:07
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