summaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorkgershov <[email protected]>2026-06-19 16:53:22 +0300
committerkgershov <[email protected]>2026-06-19 17:30:21 +0300
commitbe3766e32550798ea5fe60cb2a13d703ff818636 (patch)
treede80cca0af23fbd4d69d2309e445d89d87a1b619 /library/cpp
parent3d79ff71a5cb0a74ef11f187827a2955ff83b355 (diff)
[monlib] Fix use-after-free in TMonService2 destructor
TMonService2 binds `this` into the HTTP handler stored in TMtHttpServer. Stop() was only called from TImpl::~TImpl() — after TMonService2 members (IndexMonPage, AuthProvider_) had already been destroyed. A concurrent request could call ServeRequest() and crash on IndexMonPage->Output(). Fix: call Stop() in ~TMonService2() before member destruction. commit_hash:f5b6aff5d9f85ae76d121a036bfd30094377c5ca
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/monlib/service/monservice.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/cpp/monlib/service/monservice.h b/library/cpp/monlib/service/monservice.h
index 3116a767654..299b9a48a4f 100644
--- a/library/cpp/monlib/service/monservice.h
+++ b/library/cpp/monlib/service/monservice.h
@@ -45,6 +45,7 @@ namespace NMonitoring {
explicit TMonService2(const THttpServerOptions& options, TSimpleSharedPtr<IThreadPool> pool, const TString& title = GetProgramName(), THolder<IAuthProvider> auth = nullptr);
~TMonService2() override {
+ Stop();
}
const char* GetStartTime() const {