Skip to content

Commit

Permalink
[pipelineX](fix) Fix heap-use-after-free for AggSource dependency (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel39 authored Dec 29, 2023
1 parent a57ad36 commit 70f5a26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions be/src/pipeline/pipeline_x/dependency.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ static constexpr auto TIME_UNIT_DEPENDENCY_LOG = 30 * 1000L * 1000L * 1000L;
static_assert(TIME_UNIT_DEPENDENCY_LOG < SLOW_DEPENDENCY_THRESHOLD);

struct BasicSharedState {
Dependency* source_dep = nullptr;
Dependency* sink_dep = nullptr;
DependencySPtr source_dep = nullptr;
DependencySPtr sink_dep = nullptr;

virtual Status close(RuntimeState* state) { return Status::OK(); }
virtual ~BasicSharedState() = default;
Expand Down
8 changes: 4 additions & 4 deletions be/src/pipeline/pipeline_x/operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ Status PipelineXLocalState<DependencyType>::init(RuntimeState* state, LocalState
_shared_state =
(typename DependencyType::SharedState*)_dependency->shared_state().get();

_shared_state->source_dep = _dependency;
_shared_state->sink_dep = deps.front().get();
_shared_state->source_dep = info.dependency;
_shared_state->sink_dep = deps.front();
} else if constexpr (!is_fake_shared) {
_dependency->set_shared_state(deps.front()->shared_state());
_shared_state =
(typename DependencyType::SharedState*)_dependency->shared_state().get();

_shared_state->source_dep = _dependency;
_shared_state->sink_dep = deps.front().get();
_shared_state->source_dep = info.dependency;
_shared_state->sink_dep = deps.front();
}
}

Expand Down

0 comments on commit 70f5a26

Please sign in to comment.