summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/sockets
diff options
context:
space:
mode:
authorValeri <v19930312@gmail.com>2022-03-15 12:06:34 +0100
committerGitHub <noreply@github.com>2022-03-15 12:06:34 +0100
commit9e633999d6ffb64c9c21ac7f4b9be565fdec8e05 (patch)
treebc5170826b004f867b884aab186b9089ff177500 /src/core/hle/service/sockets
parentMerge pull request #8006 from BytesGalore/fix_cmake_missing_qt5_dbus (diff)
downloadyuzu-9e633999d6ffb64c9c21ac7f4b9be565fdec8e05.tar
yuzu-9e633999d6ffb64c9c21ac7f4b9be565fdec8e05.tar.gz
yuzu-9e633999d6ffb64c9c21ac7f4b9be565fdec8e05.tar.bz2
yuzu-9e633999d6ffb64c9c21ac7f4b9be565fdec8e05.tar.lz
yuzu-9e633999d6ffb64c9c21ac7f4b9be565fdec8e05.tar.xz
yuzu-9e633999d6ffb64c9c21ac7f4b9be565fdec8e05.tar.zst
yuzu-9e633999d6ffb64c9c21ac7f4b9be565fdec8e05.zip
Diffstat (limited to 'src/core/hle/service/sockets')
-rw-r--r--src/core/hle/service/sockets/bsd.cpp4
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};
}