Skip to content

Commit fd7fef2

Browse files
ChrysafisChrysafis
authored andcommitted
[C++]: Fix potential dereference of nullptr
1 parent 8c2d93c commit fd7fef2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cpp/src/arrow/c/bridge.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ namespace {
533533
struct ExportedArrayPrivateData : PoolAllocationMixin<ExportedArrayPrivateData> {
534534
// The buffers are owned by the ArrayData member
535535
SmallVector<const void*, 3> buffers_;
536-
struct ArrowArray dictionary_ {};
536+
struct ArrowArray dictionary_{};
537537
SmallVector<struct ArrowArray, 1> children_;
538538
SmallVector<struct ArrowArray*, 4> child_pointers_;
539539

@@ -2629,6 +2629,10 @@ class AsyncRecordBatchIterator {
26292629

26302630
private_data->state_->schema_ = maybe_schema.MoveValueUnsafe();
26312631
private_data->fut_iterator_.MarkFinished(private_data->state_);
2632+
if (self->producer == nullptr) {
2633+
private_data->fut_iterator_.MarkFinished(Status::Invalid("Missing producer"));
2634+
return EINVAL;
2635+
}
26322636
self->producer->request(self->producer,
26332637
static_cast<int64_t>(private_data->state_->queue_size_));
26342638
return 0;

0 commit comments

Comments
 (0)