Use SafeStrcpy in OnConVarChanged to ensure a null-terminated buffer (#2458)

This commit is contained in:
SCP-076
2026-05-12 23:46:07 -07:00
committed by GitHub
parent 07735c1fe2
commit 5288927964
+1 -1
View File
@@ -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);