-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-12568: [C++][Compute] Fix nullptr deference when array contains no nulls #10184
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
Conversation
|
Appveyor CI failure looks a spurious network issue: |
|
Turns out there are more "buffers[0]->data()" codes where "buffers[0]" is not checked for null.
Shall we include all fixes in this single PR? @kszucs @pitrou EDIT: fixes included in this pr. |
|
@cyb70289 That would be nice, yes! |
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, some more comments.
| @@ -175,15 +175,24 @@ struct KleeneAnd : Commutative<KleeneAnd> { | |||
| } | |||
|
|
|||
| if (right_true) { | |||
| GetBitmap(*out, 0).CopyFrom(GetBitmap(left, 0)); | |||
| if (left.GetNullCount() == 0) { | |||
| GetBitmap(*out, 0).SetBitsTo(true); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about instead:
out->null_count = 0;
out->buffers[0] = nullptr;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Looks it's better to tell the scalar kernel framework not to pre-allocate the valid buffer.
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, thank you @cyb70289
… no nulls Closes apache#10184 from cyb70289/12568-cast-crash Lead-authored-by: Yibo Cai <yibo.cai@arm.com> Co-authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
No description provided.