From 512e161afd03e7a7f3baebeeccb4910282993a0f Mon Sep 17 00:00:00 2001 From: Vukasin Milovanovic Date: Tue, 18 Jan 2022 18:51:52 -0800 Subject: [PATCH] Add check for negative stripe index in ORC reader (#10074) 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: https://github.com/rapidsai/cudf/pull/10074 --- cpp/src/io/orc/aggregate_orc_metadata.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpp/src/io/orc/aggregate_orc_metadata.cpp b/cpp/src/io/orc/aggregate_orc_metadata.cpp index 3d43042842f..a4ae9999a19 100644 --- a/cpp/src/io/orc/aggregate_orc_metadata.cpp +++ b/cpp/src/io/orc/aggregate_orc_metadata.cpp @@ -172,9 +172,10 @@ std::vector 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( - per_file_metadata[src_file_idx].ff.stripes.size()), - "Invalid stripe index"); + CUDF_EXPECTS( + stripe_idx >= 0 and stripe_idx < static_cast( + 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;