Commit 93d001fa authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ws2_32: Check if the socket is bound in ConnectEx() in the server.

parent 5295cc27
......@@ -2014,22 +2014,10 @@ static BOOL WINAPI WS2_ConnectEx( SOCKET s, const struct WS_sockaddr *name, int
struct afd_connect_params *params;
void *cvalue = NULL;
NTSTATUS status;
int fd, ret;
TRACE( "socket %#lx, ptr %p %s, length %d, send_buffer %p, send_len %u, overlapped %p\n",
s, name, debugstr_sockaddr(name), namelen, send_buffer, send_len, overlapped );
if ((fd = get_sock_fd( s, FILE_READ_DATA, NULL )) == -1)
return FALSE;
if ((ret = is_fd_bound( fd, NULL, NULL )) <= 0)
{
SetLastError( ret ? wsaErrno() : WSAEINVAL );
release_sock_fd( s, fd );
return FALSE;
}
release_sock_fd( s, fd );
if (!overlapped)
{
SetLastError( WSA_INVALID_PARAMETER );
......
......@@ -2126,6 +2126,12 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
send_len = get_req_data_size() - sizeof(*params) - params->addr_len;
addr = (const struct WS_sockaddr *)(params + 1);
if (!params->synchronous && !sock->bound)
{
set_error( STATUS_INVALID_PARAMETER );
return 0;
}
if (sock->accept_recv_req)
{
set_error( STATUS_INVALID_PARAMETER );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment