From a9ce39dee0057abeefc4584de1575d7b32957cc4 Mon Sep 17 00:00:00 2001 From: Vincent Herbet Date: Tue, 24 Jul 2018 10:37:05 +0200 Subject: [PATCH] Fix a buffer issue in server_changelevel forward caused by engine_changelevel native (#503) --- amxmodx/amxmodx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 2cfeec5e..396d9237 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -2615,11 +2615,11 @@ static cell AMX_NATIVE_CALL change_task(AMX *amx, cell *params) static cell AMX_NATIVE_CALL engine_changelevel(AMX *amx, cell *params) { int length; - const char* new_map = get_amxstring(amx, params[1], 0, length); + ke::AString new_map(get_amxstring(amx, params[1], 0, length)); // Same as calling "changelevel" command but will trigger "server_changelevel" AMXX forward as well. // Filling second param will call "changelevel2" command, but this is not usable in multiplayer game. - g_pEngTable->pfnChangeLevel(new_map, NULL); + g_pEngTable->pfnChangeLevel(new_map.chars(), NULL); return 1; }