From 54c43dd6ce830158719c3a5aa8c75de68932ed6c Mon Sep 17 00:00:00 2001 From: Blixibon Date: Tue, 27 Apr 2021 10:55:33 -0500 Subject: [PATCH] Fixed unreliable string pointer in CLogicPlayerProxy::AcceptInput() --- sp/src/game/server/hl2/hl2_player.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sp/src/game/server/hl2/hl2_player.cpp b/sp/src/game/server/hl2/hl2_player.cpp index fe523806..a43cfe32 100644 --- a/sp/src/game/server/hl2/hl2_player.cpp +++ b/sp/src/game/server/hl2/hl2_player.cpp @@ -4734,7 +4734,8 @@ bool CLogicPlayerProxy::AcceptInput( const char *szInputName, CBaseEntity *pActi { DevMsg("logic_playerproxy: Player not found!\n"); - g_EventQueue.AddEvent("!player", szInputName, Value, 0.01f, pActivator, pCaller); + // Need to allocate the string here in case szInputName is freed before the input fires + g_EventQueue.AddEvent("!player", STRING( AllocPooledString(szInputName) ), Value, 0.01f, pActivator, pCaller); } }