mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
bsd: Allow inexact match for address length in AcceptImpl
Minecraft passes in zero for length, but this should account for all possible cases
This commit is contained in:
parent
59d2a38daa
commit
9e633999d6
1 changed files with 2 additions and 2 deletions
|
@ -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.socket = std::move(result.socket);
|
||||||
new_descriptor.is_connection_based = descriptor.is_connection_based;
|
new_descriptor.is_connection_based = descriptor.is_connection_based;
|
||||||
|
|
||||||
ASSERT(write_buffer.size() == sizeof(SockAddrIn));
|
|
||||||
const SockAddrIn guest_addr_in = Translate(result.sockaddr_in);
|
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};
|
return {new_fd, Errno::SUCCESS};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue