mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
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:
parent
4fa8238a46
commit
ff71efebb6
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user