wgtmac commented on code in PR #47185: URL: https://github.com/apache/arrow/pull/47185#discussion_r2295441589
########## cpp/src/parquet/decoder.cc: ########## @@ -207,6 +207,10 @@ struct ArrowBinaryHelper<FLBAType, ::arrow::FixedSizeBinaryType> { Status AppendValue(const uint8_t* data, int32_t length, std::optional<int64_t> estimated_remaining_data_length = {}) { + if (ARROW_PREDICT_FALSE(length != acc_->byte_width())) { + return Status::Invalid("FLBAType requires fixed-length values length to be ", + acc_->byte_width(), "but got ", length); Review Comment: ```suggestion return Status::Invalid("FLBA type requires fixed-length ", acc_->byte_width(), " but got ", length); ``` ########## cpp/src/parquet/decoder.cc: ########## @@ -207,6 +207,10 @@ struct ArrowBinaryHelper<FLBAType, ::arrow::FixedSizeBinaryType> { Status AppendValue(const uint8_t* data, int32_t length, std::optional<int64_t> estimated_remaining_data_length = {}) { + if (ARROW_PREDICT_FALSE(length != acc_->byte_width())) { Review Comment: Did the inequality happen in the fuzz test? ########## cpp/src/arrow/array/builder_binary.cc: ########## @@ -162,7 +164,13 @@ void FixedSizeBinaryBuilder::Reset() { Status FixedSizeBinaryBuilder::Resize(int64_t capacity) { RETURN_NOT_OK(CheckCapacity(capacity)); - RETURN_NOT_OK(byte_builder_.Resize(capacity * byte_width_)); + int64_t dest_capacity_bytes; + if (ARROW_PREDICT_FALSE( + MultiplyWithOverflow(capacity, byte_width_, &dest_capacity_bytes))) { + return Status::CapacityError("Resize: capacity too large for byte width (requested: ", Review Comment: ```suggestion return Status::CapacityError("Resize: capacity overflows (requested: ", ``` -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org