wgtmac commented on code in PR #2629:
URL: https://github.com/apache/orc/pull/2629#discussion_r3300894069


##########
c++/src/Reader.cc:
##########
@@ -884,14 +884,21 @@ namespace orc {
   void ReaderImpl::readMetadata() const {
     uint64_t metadataSize = contents_->postscript->metadata_length();
     uint64_t footerLength = contents_->postscript->footer_length();
-    if (fileLength_ < metadataSize + footerLength + postscriptLength_ + 1) {
+
+    // Check for overflow in length calculations
+    uint64_t totalTail;
+    if (__builtin_add_overflow(footerLength, metadataSize, &totalTail) ||

Review Comment:
   This does not work for Windows unfortunately



-- 
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