GH-1246: validate decimal byte length before writing in setBigEndian - #1247
Open
Arawoof06 wants to merge 1 commit into
Open
GH-1246: validate decimal byte length before writing in setBigEndian#1247Arawoof06 wants to merge 1 commit into
Arawoof06 wants to merge 1 commit into
Conversation
Arawoof06
requested review from
jbonofre,
laurentgo,
lidavidm and
wgtmac
as code owners
July 23, 2026 09:32
This comment has been minimized.
This comment has been minimized.
Member
|
@Arawoof06 please rebase. |
Arawoof06
force-pushed
the
decimal-setbigendian-length-check
branch
from
August 25, 2026 11:11
d4485f1 to
1e2344a
Compare
Contributor
Author
|
Rebased on main, should be good now. |
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.
What's Changed
setBigEndian(int, byte[])onDecimalVectorandDecimal256Vectorbyte-swaps the value into the fixed-width slot with uncheckedMemoryUtilwrites and only checks the length afterwards, so a byte array longer than the type width overruns the slot into adjacent off-heap memory before theIllegalArgumentExceptionfires.setBigEndianSafe(int, long, ArrowBuf, int)does the same write with no length check at all. This moves the length check ahead of the write and adds it to the safe variant, so oversized input is rejected before any memory is touched; valid lengths are unaffected.Closes #1246.