IPC: add safety warranty on slot numbers

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-03-04 00:11:11 +01:00 committed by refractionpcsx2
parent 0142d33d5c
commit df7ee3b166
1 changed files with 2 additions and 1 deletions

View File

@ -56,7 +56,8 @@ SocketIPC::SocketIPC(SysCoreThread* vm, unsigned int slot)
return;
}
if ((m_sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
m_sock = socket(AF_INET, SOCK_STREAM, 0);
if ((m_sock == INVALID_SOCKET) || slot > 65536)
{
Console.WriteLn(Color_Red, "IPC: Cannot open socket! Shutting down...");
return;