Skip to content

GH-1261: Reject out-of-range dictionary indices in decode - #1262

Open
Arawoof06 wants to merge 1 commit into
apache:mainfrom
Arawoof06:dictionary-index-bounds-check
Open

GH-1261: Reject out-of-range dictionary indices in decode#1262
Arawoof06 wants to merge 1 commit into
apache:mainfrom
Arawoof06:dictionary-index-bounds-check

Conversation

@Arawoof06

Copy link
Copy Markdown
Contributor

DictionaryEncoder.retrieveIndexVector guards each index with indexAsInt > dictionaryCount, but valid indices run 0..dictionaryCount-1, so an index equal to the count reads one slot past the dictionary vector and a negative index from a signed index type is not caught at all; both reach copyValueSafe. The index vector is decoded straight from an IPC payload, so a crafted dictionary-encoded batch reads out of bounds of the dictionary buffers when arrow.enable_unsafe_memory_access is set. Tightening the bound to reject negative indices and indices past the count also covers the list and struct sub-field decoders, which go through the same helper.

Closes #1261.

@jbonofre jbonofre added the bug-fix PRs that fix a big. label Aug 27, 2026
@apache apache deleted a comment from github-actions Bot Aug 27, 2026
@jbonofre jbonofre added this to the 20.0.0 milestone Aug 27, 2026
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

bug-fix PRs that fix a big.

项目

None yet

Development

Successfully merging this pull request may close these issues.

DictionaryEncoder.decode accepts out-of-range dictionary indices

2 participants