From 598739508328c578ec8aa68ea8dcd4586dd19903 Mon Sep 17 00:00:00 2001 From: Alek5andr-Kotov Date: Sat, 6 Dec 2025 14:23:11 +0300 Subject: [PATCH] heap-use-after-free in a PQ tablet (#30257) --- ydb/core/persqueue/pqtablet/pq_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ydb/core/persqueue/pqtablet/pq_impl.cpp b/ydb/core/persqueue/pqtablet/pq_impl.cpp index 8c3ef7b0be92..6849edf05802 100644 --- a/ydb/core/persqueue/pqtablet/pq_impl.cpp +++ b/ydb/core/persqueue/pqtablet/pq_impl.cpp @@ -5204,8 +5204,10 @@ void TPersQueue::BeginDeletePartitions(const TWriteId& writeId, TTxWriteInfo& wr PQ_LOG_TX_D("Already deleting WriteInfo"); return; } + writeInfo.Deleting = true; if (writeInfo.Partitions.empty()) { TryDeleteWriteId(writeId, writeInfo, ActorContext()); + TxWritesChanged = true; } else { for (auto& [_, partitionId] : writeInfo.Partitions) { PQ_ENSURE(Partitions.contains(partitionId)); @@ -5214,7 +5216,6 @@ void TPersQueue::BeginDeletePartitions(const TWriteId& writeId, TTxWriteInfo& wr Send(partition.Actor, new TEvPQ::TEvDeletePartition); } } - writeInfo.Deleting = true; } void TPersQueue::BeginDeletePartitions(const TDistributedTransaction& tx)