diff options
author | gdkchan <gab.dark.100@gmail.com> | 2024-01-29 12:28:32 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-29 16:28:32 +0100 |
commit | 30bdc4544e5270ba0676e3a288b947b685aa1cab (patch) | |
tree | 8377881ae1caae7cc760d6725a7c76dcdd63022a | |
parent | f6475cca175cc1132167aaa805a0afa5aea8954e (diff) |
Fix NRE when calling GetSockName before Bind (#6206)1.1.1142
-rw-r--r-- | src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs index 870a6b36..1e8a9005 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/IClient.cs @@ -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)] |