From ff71efebb69969afd026cf3077fae31e8caa980b Mon Sep 17 00:00:00 2001 From: ayeteadoe Date: Thu, 21 Aug 2025 16:41:20 -0700 Subject: [PATCH] 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 --- Libraries/LibCore/SocketWindows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibCore/SocketWindows.cpp b/Libraries/LibCore/SocketWindows.cpp index d17ec2723e5..f57eb4a3b0c 100644 --- a/Libraries/LibCore/SocketWindows.cpp +++ b/Libraries/LibCore/SocketWindows.cpp @@ -116,7 +116,7 @@ ErrorOr 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; }