mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix client use-after-free reported by mmmds
Fix https://github.com/teeworlds/teeworlds/issues/2645
The `Sv_ReadyToEnter` net message is only valid while we're still
loading stuff, it is used to signal that we can send the `ENTERGAME`
system message. Simply ignoring the server message while we're in the
wrong part of the state machine works.
(cherry picked from commit a97f8a22de
)
This commit is contained in:
parent
3d3c190cd4
commit
ce2f29b5f1
|
@ -655,6 +655,12 @@ void CClient::EnterGame()
|
|||
if(State() == IClient::STATE_DEMOPLAYBACK)
|
||||
return;
|
||||
|
||||
if(State() == IClient::STATE_ONLINE)
|
||||
{
|
||||
// Don't reset everything while already in game.
|
||||
return;
|
||||
}
|
||||
|
||||
// now we will wait for two snapshots
|
||||
// to finish the connection
|
||||
SendEnterGame();
|
||||
|
|
Loading…
Reference in a new issue