Protect against invalid socket data potentially causing crashes

This commit is contained in:
baldurk
2023-08-04 17:06:03 +01:00
parent 65859d13bf
commit 9995c1f0cf
3 changed files with 13 additions and 0 deletions
+4
View File
@@ -180,6 +180,8 @@ static bool HandleHandshakeClient(ActiveClient &activeClient, ClientThread *thre
{
ReadSerialiser ser(new StreamReader(threadData->socket, Ownership::Nothing), Ownership::Stream);
ser.SetStreamingMode(true);
// this thread just handles receiving the handshake and sending a busy signal without blocking
// the server thread
RemoteServerPacket type = ser.ReadChunk<RemoteServerPacket>();
@@ -1206,6 +1208,8 @@ RENDERDOC_CreateRemoteServerConnection(const rdcstr &URL, IRemoteServer **rend)
{
ReadSerialiser ser(new StreamReader(sock, Ownership::Nothing), Ownership::Stream);
ser.SetStreamingMode(true);
RemoteServerPacket type = ser.ReadChunk<RemoteServerPacket>();
uint32_t remoteVersion = 0;