summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlnaz Nizametdinov <[email protected]>2025-09-25 21:22:03 +0300
committerGitHub <[email protected]>2025-09-25 18:22:03 +0000
commitbb7d110ebf05cdff0b12eeed9a3edc9ebec103b4 (patch)
treea09e07680c12cd2375beba63a79784db9bd60e43
parent1d3e6c85e48f259b1d584d0cff2716256b921376 (diff)
Fix use-after-free (#25815)
-rw-r--r--ydb/core/mind/hive/hive_events.h4
-rw-r--r--ydb/core/mind/hive/tablet_info.cpp2
-rw-r--r--ydb/core/mind/hive/tablet_info.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/ydb/core/mind/hive/hive_events.h b/ydb/core/mind/hive/hive_events.h
index f3b6e0a3301..e0e199b4c27 100644
--- a/ydb/core/mind/hive/hive_events.h
+++ b/ydb/core/mind/hive/hive_events.h
@@ -89,9 +89,9 @@ struct TEvPrivate {
struct TEvRestartComplete : TEventLocal<TEvRestartComplete, EvRestartComplete> {
TFullTabletId TabletId;
- TStringBuf Status;
+ TString Status;
- TEvRestartComplete(TFullTabletId tabletId, TStringBuf status)
+ TEvRestartComplete(TFullTabletId tabletId, const TString& status)
: TabletId(tabletId)
, Status(status)
{}
diff --git a/ydb/core/mind/hive/tablet_info.cpp b/ydb/core/mind/hive/tablet_info.cpp
index 37376d97076..afa722cd40a 100644
--- a/ydb/core/mind/hive/tablet_info.cpp
+++ b/ydb/core/mind/hive/tablet_info.cpp
@@ -545,7 +545,7 @@ bool TTabletInfo::RestartsOften() const {
return Statistics.RestartTimestampSize() >= Hive.GetTabletRestartsMaxCount();
}
-void TTabletInfo::NotifyOnRestart(TString status, TSideEffects& sideEffects) {
+void TTabletInfo::NotifyOnRestart(const TString& status, TSideEffects& sideEffects) {
for (auto actorId : ActorsToNotifyOnRestart) {
sideEffects.Send(actorId, new TEvPrivate::TEvRestartComplete(GetFullTabletId(), status));
}
diff --git a/ydb/core/mind/hive/tablet_info.h b/ydb/core/mind/hive/tablet_info.h
index aa40701b35f..050b010f37c 100644
--- a/ydb/core/mind/hive/tablet_info.h
+++ b/ydb/core/mind/hive/tablet_info.h
@@ -310,7 +310,7 @@ public:
return std::get<NMetrics::EResource::Counter>(GetResourceCurrentValues()) > 0;
}
- void NotifyOnRestart(TString status, TSideEffects& sideEffects);
+ void NotifyOnRestart(const TString& status, TSideEffects& sideEffects);
};