Skip to content

Commit 00aba94

Browse files
Gliniakgibbed
authored andcommitted
[NET] NetDll___WSAFDIsSet: Fixed incorrect endianness of fd_count
Plus: limit it to 64 entries Thanks to Bo98 for pointing that out
1 parent 07e81fe commit 00aba94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/xenia/kernel/xam/xam_net.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,9 @@ DECLARE_XAM_EXPORT1(NetDll_sendto, kNetworking, kImplemented);
10171017

10181018
dword_result_t NetDll___WSAFDIsSet_entry(dword_t socket_handle,
10191019
pointer_t<x_fd_set> fd_set) {
1020-
for (uint32_t i = 0; i < fd_set->fd_count.value; i++) {
1020+
const uint8_t max_fd_count =
1021+
std::min((uint32_t)fd_set->fd_count, uint32_t(64));
1022+
for (uint8_t i = 0; i < max_fd_count; i++) {
10211023
if (fd_set->fd_array[i] == socket_handle) {
10221024
return 1;
10231025
}

0 commit comments

Comments
 (0)