bkietz commented on code in PR #35628:
URL: https://github.com/apache/arrow/pull/35628#discussion_r1231471707
##########
cpp/src/arrow/array/validate.cc:
##########
@@ -595,6 +614,61 @@ struct ValidateArrayImpl {
return Status::OK();
}
+ Status ValidateBinaryView(const BinaryViewType& type) {
+ int64_t headers_byte_size = data.buffers[1]->size();
+ int64_t required_headers = data.length + data.offset;
+ if (static_cast<int64_t>(headers_byte_size / sizeof(StringHeader)) <
+ required_headers) {
+ return Status::Invalid("Header buffer size (bytes): ", headers_byte_size,
+ " isn't large enough for length: ", data.length,
+ " and offset: ", data.offset);
+ }
+
Review Comment:
The other validate methods don't check for a buffer which is too large. It
is odd, though- @pitrou ?
--
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]