rok commented on code in PR #37533:
URL: https://github.com/apache/arrow/pull/37533#discussion_r1435088583


##########
cpp/src/arrow/extension/fixed_shape_tensor.cc:
##########
@@ -340,6 +391,12 @@ Result<std::shared_ptr<DataType>> 
FixedShapeTensorType::Make(
     return Status::Invalid("dim_names size must match shape size. Expected: ",
                            shape.size(), " Got: ", dim_names.size());
   }
+  for (auto i : permutation) {
+    if (i < 0 || i >= static_cast<int64_t>(shape.size())) {
+      return Status::Invalid("permutation indices must be in [0, 
shape.size()). Got: ",
+                             i);
+    }

Review Comment:
   Changed the check and added a test: 
https://github.com/apache/arrow/pull/37533/commits/37b398e5d266c0543b366513e4a7b42641ca6f94



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to