Compare commits

...

1 Commits

Author SHA1 Message Date
gdkchan
30bdc4544e Fix NRE when calling GetSockName before Bind (#6206) 2024-01-29 16:28:32 +01:00

View File

@@ -121,7 +121,14 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
{
IPEndPoint endPoint = isRemote ? socket.RemoteEndPoint : socket.LocalEndPoint;
context.Memory.Write(bufferPosition, BsdSockAddr.FromIPEndPoint(endPoint));
if (endPoint != null)
{
context.Memory.Write(bufferPosition, BsdSockAddr.FromIPEndPoint(endPoint));
}
else
{
context.Memory.Write(bufferPosition, new BsdSockAddr());
}
}
[CommandCmif(0)]