From 23b6d15aef39225abc0726dabd38191ed7681da6 Mon Sep 17 00:00:00 2001 From: vuule Date: Tue, 18 Jan 2022 16:42:06 -0800 Subject: [PATCH 1/2] add check for negative stripe index --- cpp/src/io/orc/aggregate_orc_metadata.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/io/orc/aggregate_orc_metadata.cpp b/cpp/src/io/orc/aggregate_orc_metadata.cpp index 3d43042842f..031ff3151a7 100644 --- a/cpp/src/io/orc/aggregate_orc_metadata.cpp +++ b/cpp/src/io/orc/aggregate_orc_metadata.cpp @@ -172,7 +172,7 @@ 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( + 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( From 28506bf193a6d18b260ed524c18e5a17055ee658 Mon Sep 17 00:00:00 2001 From: vuule Date: Tue, 18 Jan 2022 16:48:24 -0800 Subject: [PATCH 2/2] style fix --- 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 031ff3151a7..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 >= 0 and 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;