bsd: Check if socket is bound before calling RecvFrom() (#3761)

This commit is contained in:
TSRBerry 2022-10-15 22:52:49 +02:00 committed by Matt Heins
parent fd680457a1
commit 7f0942da3a

View file

@ -235,6 +235,13 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
shouldBlockAfterOperation = true;
}
if (!Socket.IsBound)
{
receiveSize = -1;
return LinuxError.EOPNOTSUPP;
}
receiveSize = Socket.ReceiveFrom(buffer[..size], ConvertBsdSocketFlags(flags), ref temp);
remoteEndPoint = (IPEndPoint)temp;
@ -519,4 +526,4 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
}
}
}
}
}