ddnet/src/game/server
Robert Müller 24b30434da Handle CServer::GetClientInfo return to fix use of undefined value
```
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:790:2: error: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn,-warnings-as-errors]
        return Info.m_DDNetVersion;
        ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:785:5: note: Assuming 'ClientID' is not equal to SERVER_DEMO_CLIENT
        if(ClientID == SERVER_DEMO_CLIENT)
           ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:785:2: note: Taking false branch
        if(ClientID == SERVER_DEMO_CLIENT)
        ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:789:2: note: Calling 'CServer::GetClientInfo'
        GetClientInfo(ClientID, &Info);
        ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:646:13: note: Assuming 'ClientID' is >= 0
        dbg_assert(ClientID >= 0 && ClientID < MAX_CLIENTS, "client_id is not valid");
                   ^
/home/runner/work/ddnet/ddnet/src/base/tl/../system.h:58:38: note: expanded from macro 'dbg_assert'
#define dbg_assert(test, msg) assert(test)
                                     ^
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:646:13: note: Left side of '&&' is true
        dbg_assert(ClientID >= 0 && ClientID < MAX_CLIENTS, "client_id is not valid");
                   ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:646:30: note: Assuming 'ClientID' is < MAX_CLIENTS
        dbg_assert(ClientID >= 0 && ClientID < MAX_CLIENTS, "client_id is not valid");
                                    ^
/home/runner/work/ddnet/ddnet/src/base/tl/../system.h:58:38: note: expanded from macro 'dbg_assert'
#define dbg_assert(test, msg) assert(test)
                                     ^
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:646:2: note: '?' condition is true
        dbg_assert(ClientID >= 0 && ClientID < MAX_CLIENTS, "client_id is not valid");
        ^
/home/runner/work/ddnet/ddnet/src/base/tl/../system.h:58:31: note: expanded from macro 'dbg_assert'
#define dbg_assert(test, msg) assert(test)
                              ^
/usr/include/assert.h:93:7: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
      ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:647:13: note: 'pInfo' is not equal to null
        dbg_assert(pInfo != 0, "info can not be null");
                   ^
/home/runner/work/ddnet/ddnet/src/base/tl/../system.h:58:38: note: expanded from macro 'dbg_assert'
#define dbg_assert(test, msg) assert(test)
                                     ^
/usr/include/assert.h:93:27: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
                          ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:647:2: note: '?' condition is true
        dbg_assert(pInfo != 0, "info can not be null");
        ^
/home/runner/work/ddnet/ddnet/src/base/tl/../system.h:58:31: note: expanded from macro 'dbg_assert'
#define dbg_assert(test, msg) assert(test)
                              ^
/usr/include/assert.h:93:7: note: expanded from macro 'assert'
     (static_cast <bool> (expr)                                         \
      ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:649:5: note: Assuming field 'm_State' is not equal to STATE_INGAME
        if(m_aClients[ClientID].m_State == CClient::STATE_INGAME)
           ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:649:2: note: Taking false branch
        if(m_aClients[ClientID].m_State == CClient::STATE_INGAME)
        ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:667:2: note: Returning without writing to 'pInfo->m_DDNetVersion'
        return 0;
        ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:789:2: note: Returning from 'CServer::GetClientInfo'
        GetClientInfo(ClientID, &Info);
        ^
/home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:790:2: note: Undefined or garbage value returned to caller
        return Info.m_DDNetVersion;
        ^
```
2022-07-31 23:37:28 +02:00
..
entities Move and extend GetClientVersion to remove many version.h includes 2022-07-31 23:21:10 +02:00
gamemodes Renamed some time checkpoint related variables. 2022-07-06 15:13:55 +02:00
alloc.h Remove dead code 2022-05-31 19:32:07 +02:00
ddracechat.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
ddracecommands.cpp Remove even more redundant variables to avoid inconsistent states. Fix another swap bug. 2022-07-11 13:39:52 +02:00
entity.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
entity.h Huge variable naming format 2022-07-08 18:01:29 +02:00
eventhandler.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
eventhandler.h Huge variable naming format 2022-07-08 18:01:29 +02:00
gamecontext.cpp Handle CServer::GetClientInfo return to fix use of undefined value 2022-07-31 23:37:28 +02:00
gamecontext.h Huge variable naming format 2022-07-08 18:01:29 +02:00
gamecontroller.cpp Fix rotating plasma by Robyt3 (fixes #5666) 2022-07-28 15:42:11 +02:00
gamecontroller.h Make spawn position independent of players in other teams 2022-02-06 00:01:50 +01:00
gameworld.cpp Remove even more redundant variables to avoid inconsistent states. Fix another swap bug. 2022-07-11 13:39:52 +02:00
gameworld.h Organize game-server includes 2022-06-17 20:32:56 +02:00
player.cpp Move and extend GetClientVersion to remove many version.h includes 2022-07-31 23:21:10 +02:00
player.h Huge variable naming format 2022-07-08 18:01:29 +02:00
save.cpp Rename "NoSomething" to "SomethingDisabled" 2022-07-11 13:40:01 +02:00
save.h Rename "NoSomething" to "SomethingDisabled" 2022-07-11 13:40:01 +02:00
score.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
score.h Renamed some time checkpoint related variables. 2022-07-06 15:13:55 +02:00
scoreworker.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
scoreworker.h Replaced magic number with MAX_CHECKPOINTS 2022-07-08 18:01:33 +02:00
teams.cpp Fix shift with negative exponent in TeamMask 2022-07-22 16:42:56 +02:00
teams.h Huge variable naming format 2022-07-08 18:01:29 +02:00
teehistorian.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
teehistorian.h Organize game-server includes 2022-06-17 20:32:56 +02:00
teeinfo.cpp Huge variable naming format 2022-07-08 18:01:29 +02:00
teeinfo.h Huge variable naming format 2022-07-08 18:01:29 +02:00