Skip to content

Commit

Permalink
Add check for negative stripe index in ORC reader (#10074)
Browse files Browse the repository at this point in the history
Fixes CI failure

Authors:
  - Vukasin Milovanovic (https://github.com/vuule)

Approvers:
  - Christopher Harris (https://github.com/cwharris)
  - David Wendt (https://github.com/davidwendt)
  - Bradley Dice (https://github.com/bdice)

URL: #10074
  • Loading branch information
vuule authored Jan 19, 2022
1 parent 4e4c3dd commit 512e161
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cpp/src/io/orc/aggregate_orc_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ std::vector<metadata::stripe_source_mapping> aggregate_orc_metadata::select_stri
// Coalesce stripe info at the source file later since that makes downstream processing much
// easier in impl::read
for (const auto& stripe_idx : user_specified_stripes[src_file_idx]) {
CUDF_EXPECTS(stripe_idx < static_cast<decltype(stripe_idx)>(
per_file_metadata[src_file_idx].ff.stripes.size()),
"Invalid stripe index");
CUDF_EXPECTS(
stripe_idx >= 0 and stripe_idx < static_cast<decltype(stripe_idx)>(
per_file_metadata[src_file_idx].ff.stripes.size()),
"Invalid stripe index");
stripe_infos.push_back(
std::make_pair(&per_file_metadata[src_file_idx].ff.stripes[stripe_idx], nullptr));
row_count += per_file_metadata[src_file_idx].ff.stripes[stripe_idx].numberOfRows;
Expand Down

0 comments on commit 512e161

Please sign in to comment.