dkp116 commented on code in PR #50500:
URL: https://github.com/apache/arrow/pull/50500#discussion_r4064736542
##########
cpp/src/arrow/util/key_value_metadata.cc:
##########
@@ -121,11 +124,23 @@ Status KeyValueMetadata::DeleteMany(std::vector<int64_t>
indices) {
++shift;
const auto start = indices[i] + 1;
const auto stop = indices[i + 1];
- DCHECK_GE(start, 0);
- DCHECK_LE(start, size);
- DCHECK_GE(stop, 0);
- DCHECK_LE(stop, size);
+
+ if (ARROW_PREDICT_TRUE(start < 0 || start > size)) {
+ return Status::IndexError("KeyValueMetadata::DeleteMany: Start index ",
start - 1,
+ " out of bounds for metadata of size ", size);
+ }
Review Comment:
corrected error handle
--
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]