mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: use a more sane limit for desync check
m_RecvBuffer.max_size() can be very large, just check on RCON_MAX_PAYLOAD_SIZE (1 MiB), if its larger than that, then the stream has definitely being desynced or malformed. Also drop the client on null payloads because the payload should never be 0.
This commit is contained in:
parent
fdab5dea84
commit
b0423ee74b
@ -197,8 +197,7 @@ bool CNetConBase::ProcessBuffer(CConnectedNetConsoleData& data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.m_nPayloadLen < 0 ||
|
if (data.m_nPayloadLen <= 0 || data.m_nPayloadLen > RCON_MAX_PAYLOAD_SIZE)
|
||||||
data.m_nPayloadLen > data.m_RecvBuffer.max_size())
|
|
||||||
{
|
{
|
||||||
Error(eDLL_T::ENGINE, NO_ERROR, "RCON Cmd: sync error (%d)\n", data.m_nPayloadLen);
|
Error(eDLL_T::ENGINE, NO_ERROR, "RCON Cmd: sync error (%d)\n", data.m_nPayloadLen);
|
||||||
Disconnect("desync"); // Out of sync (irrecoverable).
|
Disconnect("desync"); // Out of sync (irrecoverable).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user