Skip to content

GH-50292: [C++][Parquet] Avoid int64 overflow in CheckReadRangeOrThrow#50060

Merged
wgtmac merged 2 commits into
apache:mainfrom
metsw24-max:page-index-range-overflow
Jun 30, 2026
Merged

GH-50292: [C++][Parquet] Avoid int64 overflow in CheckReadRangeOrThrow#50060
wgtmac merged 2 commits into
apache:mainfrom
metsw24-max:page-index-range-overflow

Conversation

@metsw24-max

@metsw24-max metsw24-max commented May 28, 2026

Copy link
Copy Markdown
Contributor

CheckReadRangeOrThrow adds index_location.offset + length unchecked, so a column-chunk page-index location near INT64_MAX wraps past the bounds check and yields an out-of-range buffer offset at read time; guard it with AddWithOverflow as merge_range already does.

@metsw24-max

Copy link
Copy Markdown
Contributor Author

gentle ping

@wgtmac wgtmac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! Just left some minor comments. BTW, according to our CONTRIBUTING.md, this PR needs a GitHub issue.

Comment thread cpp/src/parquet/page_index.cc Outdated
Comment thread cpp/src/parquet/page_index.cc Outdated
@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jun 29, 2026
@metsw24-max metsw24-max changed the title MINOR: [C++][Parquet] Avoid int64 overflow in CheckReadRangeOrThrow GH-50292: [C++][Parquet] Avoid int64 overflow in CheckReadRangeOrThrow Jun 30, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50292 has been automatically assigned in GitHub to PR creator.

@metsw24-max
metsw24-max requested a review from pitrou as a code owner June 30, 2026 07:08
@metsw24-max

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Opened #50292 for this and updated the PR title to reference it. Pushed both changes: the offset bound now short-circuits first, and the read range end is validated with AddWithOverflow as well.

@wgtmac wgtmac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @metsw24-max!

@wgtmac
wgtmac merged commit ea3ca57 into apache:main Jun 30, 2026
67 of 71 checks passed
@wgtmac wgtmac removed the awaiting committer review Awaiting committer review label Jun 30, 2026
@github-actions github-actions Bot added the awaiting committer review Awaiting committer review label Jun 30, 2026
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit ea3ca57.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants