wgtmac commented on code in PR #2622:
URL: https://github.com/apache/orc/pull/2622#discussion_r3301697706
##########
c++/src/MemoryPool.cc:
##########
@@ -52,6 +56,15 @@ namespace orc {
// PASS
}
+ template <class T>
+ uint64_t checkedBufferSize(uint64_t count) {
+ uint64_t bytes = 0;
+ if (multiplyWithOverflow(static_cast<uint64_t>(sizeof(T)), count, &bytes))
{
+ throw std::length_error("DataBuffer allocation size overflow");
Review Comment:
Do we want to define a orc-specific exception that derives from
`orc::Exception`? arrow-cpp catches all `orc::Exception` to avoid crashing.
--
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]