From 039f2c68239b345c799a4e409336f2d1a3e65923 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Thu, 27 May 2021 15:53:40 +0200 Subject: [PATCH] Fix (harmless) array OOB access when no pings were cached Use `vector.data()` instead of `&vector[0]` to get access to the underlying array. Fixes #3850. --- src/engine/client/serverbrowser_ping_cache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/client/serverbrowser_ping_cache.cpp b/src/engine/client/serverbrowser_ping_cache.cpp index 67b60c65e..2217ad9e2 100644 --- a/src/engine/client/serverbrowser_ping_cache.cpp +++ b/src/engine/client/serverbrowser_ping_cache.cpp @@ -197,7 +197,7 @@ void CServerBrowserPingCache::GetPingCache(const CEntry **ppEntries, int *pNumEn } m_aNewEntries.clear(); } - *ppEntries = &m_aEntries[0]; + *ppEntries = m_aEntries.data(); *pNumEntries = m_aEntries.size(); }