From 42fb86007720523c65036200a591256f69b37de0 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Thu, 15 Oct 2015 12:50:58 +0200 Subject: [PATCH] Fix a potential crash if SV_DropClient address could not be found --- amxmodx/meta_api.cpp | 2 +- modules/cstrike/cstrike/CstrikeHacks.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index a23bc472..cd03f377 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -1566,7 +1566,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m void *address = nullptr; - if (CommonConfig && CommonConfig->GetMemSig("SV_DropClient", &address)) + if (CommonConfig && CommonConfig->GetMemSig("SV_DropClient", &address) && address) { DropClientDetour = DETOUR_CREATE_STATIC_FIXED(SV_DropClient, address); DropClientDetour->EnableDetour(); diff --git a/modules/cstrike/cstrike/CstrikeHacks.cpp b/modules/cstrike/cstrike/CstrikeHacks.cpp index 8c004eb3..5f122ec7 100644 --- a/modules/cstrike/cstrike/CstrikeHacks.cpp +++ b/modules/cstrike/cstrike/CstrikeHacks.cpp @@ -543,11 +543,11 @@ void InitGlobalVars() if (!ServerStatic) { - MF_Log("svs global variable is not available\n"); + MF_Log("svs global variable is not available"); } if (!Server) { - MF_Log("sv global variable is not available\n"); + MF_Log("sv global variable is not available"); } } \ No newline at end of file