Skip to content

GH-46724: [C++][Parquet] OSSFuzz: Prevent from Bad-cast in handling statistics #46725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mapleFU
Copy link
Member

@mapleFU mapleFU commented Jun 5, 2025

Rationale for this change

See issue

What changes are included in this PR?

Checked before a cast here

Are these changes tested?

no

Are there any user-facing changes?

no

@mapleFU mapleFU requested a review from wgtmac as a code owner June 5, 2025 17:22
Copy link

github-actions bot commented Jun 5, 2025

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

@mapleFU mapleFU force-pushed the try-to-fix-ubsan-issue branch from e5a558e to 6abdcdb Compare June 5, 2025 17:23
@mapleFU mapleFU changed the title GH-46724: [C++][Parquet] Prevent from Bad-cast in handling statistics GH-46724: [C++][Parquet] OSSFuzz: Prevent from Bad-cast in handling statistics Jun 5, 2025
Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this. Can you first add the regression file to arrow-testing/data/parquet/fuzzing/?

@@ -122,7 +122,13 @@ static std::shared_ptr<geospatial::GeoStatistics> MakeColumnGeometryStats(

std::shared_ptr<Statistics> MakeColumnStats(const format::ColumnMetaData& meta_data,
const ColumnDescriptor* descr) {
switch (static_cast<Type::type>(meta_data.type)) {
auto metadata_type = static_cast<Type::type>(meta_data.type);
Copy link
Member

Choose a reason for hiding this comment

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

Why not use LoadEnumSafe?

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jun 9, 2025
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