Skip to content

Commit 480cb8f

Browse files
committed
Check IsRedirecting after argStream is validated
Nil would crash the server.
1 parent 942c828 commit 480cb8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Server/mods/deathmatch/logic/luadefs/CLuaPlayerDefs.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,12 +1929,6 @@ int CLuaPlayerDefs::KickPlayer(lua_State* luaVM)
19291929
CScriptArgReader argStream(luaVM);
19301930
argStream.ReadUserData(pPlayer);
19311931

1932-
if (pPlayer->IsRedirecting())
1933-
{
1934-
lua_pushboolean(luaVM, false);
1935-
return 1;
1936-
}
1937-
19381932
if (argStream.NextIsUserData())
19391933
{
19401934
CClient* pResponsible;
@@ -1961,6 +1955,12 @@ int CLuaPlayerDefs::KickPlayer(lua_State* luaVM)
19611955

19621956
if (!argStream.HasErrors())
19631957
{
1958+
if (pPlayer->IsRedirecting())
1959+
{
1960+
lua_pushboolean(luaVM, false);
1961+
return 1;
1962+
}
1963+
19641964
if (CStaticFunctionDefinitions::KickPlayer(pPlayer, strResponsible, strReason))
19651965
{
19661966
lua_pushboolean(luaVM, true);

0 commit comments

Comments
 (0)