Skip to content
Snippets Groups Projects
Unverified Commit 8c8b5359 authored by bunnei's avatar bunnei Committed by GitHub
Browse files

Merge pull request #8028 from v1993/patch-9

bsd: Allow inexact match for address length in AcceptImpl
parents fe1182e9 9e633999
No related branches found
No related tags found
No related merge requests found
......@@ -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};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment