Skip to content

Commit

Permalink
Fixed federated_topic use after free (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gazizonoki authored Nov 7, 2024
1 parent 923cc65 commit 240e2d9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ TFederatedWriteSessionImpl::TFederatedWriteSessionImpl(
, Log(Connections->GetLog())
, ClientEventsQueue(std::make_shared<NTopic::TWriteSessionEventsQueue>(Settings))
, BufferFreeSpace(Settings.MaxMemoryUsage_)
, HasBeenClosed(NThreading::NewPromise())
{
}

Expand Down
19 changes: 19 additions & 0 deletions src/client/federated_topic/impl/federated_write_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@ class TFederatedWriteSessionImpl : public NTopic::TContinuationTokenIssuer,
{
Message.Data = Data;
}

explicit TWrappedWriteMessage(const TWrappedWriteMessage& other)
: Data(other.Data)
, Message(other.Message)
{
Message.Data = Data;
}

explicit TWrappedWriteMessage(TWrappedWriteMessage&& other)
: Data(std::move(other.Data))
, Message(std::move(other.Message))
{
Message.Data = Data;
}

TWrappedWriteMessage& operator=(const TWrappedWriteMessage& other) = delete;
TWrappedWriteMessage& operator=(TWrappedWriteMessage&& other) = delete;

~TWrappedWriteMessage() = default;
};

private:
Expand Down

0 comments on commit 240e2d9

Please sign in to comment.