diff options
| author | Stefan Boberg <[email protected]> | 2026-03-21 10:46:32 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-21 10:46:32 +0100 |
| commit | 079b537ed51ed14761545af178a1d47e3291f451 (patch) | |
| tree | e4a4717783bb84add40bb5fcd58a2d59ff285a55 /src/zenserver/stats/statsreporter.cpp | |
| parent | auth fail no cache (#871) (diff) | |
| download | zen-079b537ed51ed14761545af178a1d47e3291f451.tar.xz zen-079b537ed51ed14761545af178a1d47e3291f451.zip | |
fix null stats provider crash when build store is not configured (#875)v5.7.25-pre0
- When build store is not configured, `m_BuildCidStore` is null but was unconditionally added as a stats provider, causing a null pointer dereference crash in `StatsReporter::ReportStats`
- Added a null guard in `AddProvider` to reject null pointers defensively
- Added a conditional check at the call site in `InitializeStructuredCache`
Diffstat (limited to 'src/zenserver/stats/statsreporter.cpp')
| -rw-r--r-- | src/zenserver/stats/statsreporter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/zenserver/stats/statsreporter.cpp b/src/zenserver/stats/statsreporter.cpp index a1926eba4..ff055cf18 100644 --- a/src/zenserver/stats/statsreporter.cpp +++ b/src/zenserver/stats/statsreporter.cpp @@ -40,6 +40,10 @@ StatsReporter::Shutdown() void StatsReporter::AddProvider(StatsProvider* Provider) { + if (!Provider) + { + return; + } RwLock::ExclusiveLockScope _(m_Lock); m_Providers.push_back(Provider); } |