diff options
author | bunnei <bunneidev@gmail.com> | 2022-03-19 02:06:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-19 02:06:13 +0100 |
commit | 8c8b5359f291fd78d5e3028c4287daf7230227e7 (patch) | |
tree | 4d0af42c15f7942a9d7f6481f3f05c4edd2b9068 /src/core/hle/service | |
parent | Merge pull request #8039 from ameerj/core-include (diff) | |
parent | bsd: Allow inexact match for address length in AcceptImpl (diff) | |
download | yuzu-8c8b5359f291fd78d5e3028c4287daf7230227e7.tar yuzu-8c8b5359f291fd78d5e3028c4287daf7230227e7.tar.gz yuzu-8c8b5359f291fd78d5e3028c4287daf7230227e7.tar.bz2 yuzu-8c8b5359f291fd78d5e3028c4287daf7230227e7.tar.lz yuzu-8c8b5359f291fd78d5e3028c4287daf7230227e7.tar.xz yuzu-8c8b5359f291fd78d5e3028c4287daf7230227e7.tar.zst yuzu-8c8b5359f291fd78d5e3028c4287daf7230227e7.zip |
Diffstat (limited to 'src/core/hle/service')
-rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index f83272633..3dbac5a23 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -569,9 +569,9 @@ std::pair<s32, Errno> BSD::AcceptImpl(s32 fd, std::vector<u8>& write_buffer) { new_descriptor.socket = std::move(result.socket); new_descriptor.is_connection_based = descriptor.is_connection_based; - ASSERT(write_buffer.size() == sizeof(SockAddrIn)); const SockAddrIn guest_addr_in = Translate(result.sockaddr_in); - std::memcpy(write_buffer.data(), &guest_addr_in, sizeof(guest_addr_in)); + const size_t length = std::min(sizeof(guest_addr_in), write_buffer.size()); + std::memcpy(write_buffer.data(), &guest_addr_in, length); return {new_fd, Errno::SUCCESS}; } |