Github user omalley commented on a diff in the pull request:
https://github.com/apache/orc/pull/309#discussion_r218244811
--- Diff: c++/src/Reader.cc ---
@@ -498,6 +498,12 @@ namespace orc {
const proto::Stream& stream = currentStripeFooter.streams(i);
uint64_t length = static_cast<uint64_t>(stream.length());
if (static_cast<StreamKind>(stream.kind()) ==
StreamKind::StreamKind_ROW_INDEX) {
+ if (offset + length > fileLength) {
--- End diff --
This check is really good, but it would also be nice to check that the
stream is within the stripe, although you'd need to pass that in also. We could
pass the whole proto::StripeInformation in.
---