Fix motd undef behavior

Conditional jump or move depends on uninitialised value(s)
   at 0x2158DA: int IServer::SendPackMsg<CNetMsg_Sv_Motd, 0>(CNetMsg_Sv_Motd*, int, int) (server.h:73)
   by 0x1FE02F: CGameContext::SendMotd(int) (gamecontext.cpp:538)
   by 0x20A874: CGameContext::ConchainSpecialMotdupdate(IConsole::IResult*, void*, void (*)(IConsole::IResult*, void*), void*) (gamecontext.cpp:3124)
   by 0x145A23: CConsole::Con_Chain(IConsole::IResult*, void*) (console.cpp:1202)
   by 0x132086: CConsole::ExecuteLineStroked(int, char const*, int, bool) (console.cpp:528)
   by 0x1323A7: CConsole::ExecuteLine(char const*, int, bool) (console.cpp:582)
   by 0x1326B1: CConsole::ExecuteFile(char const*, int, bool, int) (console.cpp:625)
   by 0x1C60E9: main (server.cpp:3874)
 Uninitialised value was created by a heap allocation
   at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x1C5900: CreateServer() (server.cpp:3755)
   by 0x1C5C4C: main (server.cpp:3818)
This commit is contained in:
def 2022-06-05 20:17:31 +02:00
parent 735b0bdf4a
commit de55d49c72
2 changed files with 1 additions and 13 deletions

View file

@ -1,15 +1,3 @@
{
Motd
Memcheck:Cond
fun:_ZN7IServer11SendPackMsgI15CNetMsg_Sv_MotdLi0EEEiPT_ii
fun:_ZN12CGameContext8SendMotdEi
fun:_ZN12CGameContext25ConchainSpecialMotdupdateEPN8IConsole7IResultEPvPFvS2_S3_ES3_
fun:_ZN8CConsole9Con_ChainEPN8IConsole7IResultEPv
fun:_ZN8CConsole18ExecuteLineStrokedEiPKcib
fun:_ZN8CConsole11ExecuteLineEPKcib
fun:_ZN8CConsole11ExecuteFileEPKcibi
fun:main
}
{
DemoRecorderWrite
Memcheck:Param

View file

@ -723,7 +723,7 @@ int CServer::Port() const
int CServer::MaxClients() const
{
return m_NetServer.MaxClients();
return m_RunServer == UNINITIALIZED ? 0 : m_NetServer.MaxClients();
}
int CServer::ClientCount() const