Skip to content
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

GH-45126: [C++][Parquet] Fix undefined behavior in the FormatStatValue #45127

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

wgtmac
Copy link
Member

@wgtmac wgtmac commented Dec 30, 2024

Rationale for this change

FormatStatValue function in the parquet/types.cc employs reinterpret_cast to cast bytes to specific data types. It is undefined behavior when the bytes are unaligned.

What changes are included in this PR?

Use std::memcpy to replace reinterpret_cast.

Are these changes tested?

Pass CI.

Are there any user-facing changes?

No.

Copy link

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

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Dec 30, 2024
@wgtmac wgtmac merged commit cc56f12 into apache:main Dec 31, 2024
33 of 34 checks passed
@wgtmac wgtmac removed the awaiting committer review Awaiting committer review label Dec 31, 2024
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