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

ARROW-13104: [C++] Fix unsafe cast in ByteStreamSplit implementation #10596

Closed
wants to merge 1 commit into from

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented Jun 24, 2021

No description provided.

@pitrou pitrou requested a review from emkornfield June 24, 2021 16:51
@github-actions
Copy link

}

template <>
void ByteStreamSplitEncoder<FloatType>::PutArrowArray(const ::arrow::Array& values) {
DirectPutImpl<::arrow::FloatArray>(values,
reinterpret_cast<::arrow::BufferBuilder*>(&values_));
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the offending cast (and below as well).

@pitrou pitrou requested a review from bkietz June 29, 2021 16:02
Copy link
Contributor

@cyb70289 cyb70289 left a comment

Choose a reason for hiding this comment

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

+1.

Tested that inserting a dummy data member (before below line) or a dummy virtual function to TypedBufferBuillder crashes current code.
https://github.com/apache/arrow/blob/master/cpp/src/arrow/buffer_builder.h#L302

@pitrou
Copy link
Member Author

pitrou commented Jun 30, 2021

Thanks for the review @cyb70289 ! I will merge now (AppVeyor failure is unrelated).

@pitrou pitrou closed this in 58b3109 Jun 30, 2021
@pitrou pitrou deleted the ARROW-13104-unsafe-cast branch June 30, 2021 09:12
thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Jun 30, 2021
Closes apache#10596 from pitrou/ARROW-13104-unsafe-cast

Authored-by: Antoine Pitrou <antoine@python.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
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.

None yet

2 participants