ws2_32: Set WSAEFAULT if the bind address is null.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
63110f9879
commit
a990e25bf0
|
@ -1068,7 +1068,7 @@ int WINAPI bind( SOCKET s, const struct sockaddr *addr, int len )
|
|||
|
||||
if (!addr)
|
||||
{
|
||||
SetLastError( WSAEAFNOSUPPORT );
|
||||
SetLastError( WSAEFAULT );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -10794,7 +10794,18 @@ static void test_bind(void)
|
|||
WSASetLastError(0xdeadbeef);
|
||||
ret = bind(s, NULL, 0);
|
||||
ok(ret == -1, "expected failure\n");
|
||||
todo_wine ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError());
|
||||
ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError());
|
||||
|
||||
WSASetLastError(0xdeadbeef);
|
||||
ret = bind(s, NULL, sizeof(addr));
|
||||
ok(ret == -1, "expected failure\n");
|
||||
ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError());
|
||||
|
||||
addr.sa_family = AF_INET;
|
||||
WSASetLastError(0xdeadbeef);
|
||||
ret = bind(s, &addr, 0);
|
||||
ok(ret == -1, "expected failure\n");
|
||||
ok(WSAGetLastError() == WSAEFAULT, "got error %u\n", WSAGetLastError());
|
||||
|
||||
addr.sa_family = 0xdead;
|
||||
WSASetLastError(0xdeadbeef);
|
||||
|
|
Loading…
Reference in New Issue