From 5288927964ba20921681b1631b772759477864a8 Mon Sep 17 00:00:00 2001 From: SCP-076 <84674379+SCP-076@users.noreply.github.com> Date: Wed, 13 May 2026 14:46:07 +0800 Subject: [PATCH] Use SafeStrcpy in OnConVarChanged to ensure a null-terminated buffer (#2458) --- core/ConVarManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ConVarManager.cpp b/core/ConVarManager.cpp index 2a8c5043..466232b6 100644 --- a/core/ConVarManager.cpp +++ b/core/ConVarManager.cpp @@ -654,7 +654,7 @@ void ConVarManager::OnConVarChanged(ConVar *pConVar, const char *oldValue, float * ChangeStringValue calls that may delete[] + reallocate m_pszString * while the forward is still iterating plugin callbacks. */ char newValue[512]; - strncpy(newValue, pConVar->GetString(), sizeof(newValue)); + ke::SafeStrcpy(newValue, sizeof(newValue), pConVar->GetString()); /* Now call forwards in plugins that have hooked this */ pForward->PushCell(pInfo->handle);