Skip to content

Commit

Permalink
Fix UBSAN issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Sep 23, 2024
1 parent e857a65 commit 9a28686
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpp/src/arrow/array/array_primitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ class NumericArray : public PrimitiveArray {

void SetData(const std::shared_ptr<ArrayData>& data) {
this->PrimitiveArray::SetData(data);
values_ = reinterpret_cast<const value_type*>(raw_values_) + data_->offset;
values_ = raw_values_
? (reinterpret_cast<const value_type*>(raw_values_) + data_->offset)
: NULLPTR;
}

const value_type* values_;
Expand Down

0 comments on commit 9a28686

Please sign in to comment.