Skip to content

MINOR: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex#50038

Open
jmestwa-coder wants to merge 1 commit into
apache:mainfrom
jmestwa-coder:ipc-sparse-csx-index-overflow
Open

MINOR: [C++][IPC] Avoid int64 overflow in ReadSparseCSXIndex#50038
jmestwa-coder wants to merge 1 commit into
apache:mainfrom
jmestwa-coder:ipc-sparse-csx-index-overflow

Conversation

@jmestwa-coder
Copy link
Copy Markdown

ReadSparseCSXIndex sizes its indices/indptr buffer checks with non_zero_length * byte_width and (shape + 1) * byte_width in int64, but both come straight from the SparseTensor flatbuffer via GetSparseTensorMetadata. A non_zero_length near INT64_MAX wraps the product, so the size guard passes and the index Tensor is built over a buffer smaller than its shape. Use the checked helpers from tensor.cc.

@kou
Copy link
Copy Markdown
Member

kou commented May 25, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants