LibCore: Fix WSAEMSGSIZE error in pending_bytes with proper zero-init

In SocketWindows, the return value for the ioctl call was not
initialized to zero. This was causing test_udp in TesDNSResolver
to fail as UDPSocket::read_some() was incorrectly failing with
WSAEMSGSIZE due the result of pending_bytes being some
unspecified default value for an uninitialized unsigned long
This commit is contained in:
ayeteadoe 2025-08-21 16:41:20 -07:00 committed by Andrew Kaster
commit ff71efebb6
Notes: github-actions[bot] 2025-08-24 00:37:27 +00:00

View file

@ -116,7 +116,7 @@ ErrorOr<size_t> PosixSocketHelper::pending_bytes() const
return Error::from_windows_error(WSAENOTCONN);
}
u_long value;
u_long value = 0;
TRY(System::ioctl(m_fd, FIONREAD, &value));
return value;
}