You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by omalley <gi...@git.apache.org> on 2018/09/17 22:16:10 UTC

[GitHub] orc pull request #309: ORC-403: [C++] Add checks to avoid invalid offsets in...

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.


---