Repository navigation
Conversation
Contributor
Author
|
@neilconway @Jefffrey would either of you be interested in working on this change with me? |
adriangb
marked this pull request as ready for review
December 4, 2026 21:12
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Utf8View/BinaryViewarray toUtf8/Binarypanics with "byte array offset overflow" #12559.Rationale for this change
cast_view_to_bytereturns aResultand already computes the total value length. But it does not check that length against the offset limit of the target type. So aUtf8VieworBinaryViewarray with more thani32::MAXvalue bytes panics inGenericByteBuilder::append_valuewhen it is cast toUtf8orBinary.What changes are included in this PR?
cast_view_to_bytereturnsArrowError::ComputeErrorwhen the total value length exceedsTO::Offset::MAX_OFFSET. The message matches the list casts inarrow-cast/src/cast/list.rs.Are these changes tested?
Yes. A new unit test builds
Utf8ViewandBinaryViewarrays whose views share one 1 MiB buffer, so the logical length passesi32::MAXwithout a 2 GiB allocation.Are there any user-facing changes?
The cast returns an error where it panicked before.