You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "metsw24-max (via GitHub)" <gi...@apache.org> on 2026/05/29 05:58:29 UTC
[I] [C++] Tensor::Make skips buffer-size check for row-major (implicit strides) tensors [arrow]
metsw24-max opened a new issue, #50063:
URL: https://github.com/apache/arrow/issues/50063
When `Tensor::Make` is called without explicit strides, `ValidateTensorParameters` (cpp/src/arrow/tensor.cc) only computes row-major strides and never verifies the data buffer is large enough for the shape. The buffer-overrun guard in `CheckTensorStridesValidity` runs only when strides are supplied. A row-major tensor whose shape exceeds its backing buffer is accepted, leading to out-of-bounds reads when the tensor is consumed.
This is reachable from IPC `ReadTensor`: the shape comes from the Tensor flatbuffer and the data is the message body, whose size is independent of the shape, and the flatbuffer commonly omits strides (row-major).
```c++
auto data = Buffer::Wrap(std::vector<double>{1, 2}); // 16 bytes
// shape needs 3*100*8 = 2400 bytes; currently returns OK
auto t = Tensor::Make(float64(), data, {3, 100});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [C++] Tensor::Make skips buffer-size check for row-major (implicit strides) tensors [arrow]
Posted by "rok (via GitHub)" <gi...@apache.org>.
rok closed issue #50063: [C++] Tensor::Make skips buffer-size check for row-major (implicit strides) tensors
URL: https://github.com/apache/arrow/issues/50063
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [C++] Tensor::Make skips buffer-size check for row-major (implicit strides) tensors [arrow]
Posted by "rok (via GitHub)" <gi...@apache.org>.
rok commented on issue #50063:
URL: https://github.com/apache/arrow/issues/50063#issuecomment-4574360145
Issue resolved by pull request 50064
https://github.com/apache/arrow/pull/50064
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org