Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
68377494
Commit
68377494
authored
Sep 20, 2013
by
Bruno Jesus
Committed by
Alexandre Julliard
Sep 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: ConnectEx should not work on unbound socket.
parent
128bfdf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
socket.c
dlls/ws2_32/socket.c
+13
-1
sock.c
dlls/ws2_32/tests/sock.c
+1
-1
No files found.
dlls/ws2_32/socket.c
View file @
68377494
...
@@ -2726,6 +2726,8 @@ static BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int n
...
@@ -2726,6 +2726,8 @@ static BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int n
PVOID
sendBuf
,
DWORD
sendBufLen
,
LPDWORD
sent
,
LPOVERLAPPED
ov
)
PVOID
sendBuf
,
DWORD
sendBufLen
,
LPDWORD
sent
,
LPOVERLAPPED
ov
)
{
{
int
fd
,
ret
,
status
;
int
fd
,
ret
,
status
;
union
generic_unix_sockaddr
uaddr
;
socklen_t
uaddrlen
=
sizeof
(
uaddr
);
if
(
!
ov
)
if
(
!
ov
)
{
{
...
@@ -2743,7 +2745,17 @@ static BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int n
...
@@ -2743,7 +2745,17 @@ static BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int n
TRACE
(
"socket %04lx, ptr %p %s, length %d, sendptr %p, len %d, ov %p
\n
"
,
TRACE
(
"socket %04lx, ptr %p %s, length %d, sendptr %p, len %d, ov %p
\n
"
,
s
,
name
,
debugstr_sockaddr
(
name
),
namelen
,
sendBuf
,
sendBufLen
,
ov
);
s
,
name
,
debugstr_sockaddr
(
name
),
namelen
,
sendBuf
,
sendBufLen
,
ov
);
/* FIXME: technically the socket has to be bound */
if
(
getsockname
(
fd
,
&
uaddr
.
addr
,
&
uaddrlen
)
!=
0
)
{
SetLastError
(
wsaErrno
());
return
FALSE
;
}
else
if
(
!
is_sockaddr_bound
(
&
uaddr
.
addr
,
uaddrlen
))
{
SetLastError
(
WSAEINVAL
);
return
FALSE
;
}
ret
=
do_connect
(
fd
,
name
,
namelen
);
ret
=
do_connect
(
fd
,
name
,
namelen
);
if
(
ret
==
0
)
if
(
ret
==
0
)
{
{
...
...
dlls/ws2_32/tests/sock.c
View file @
68377494
...
@@ -5097,7 +5097,7 @@ static void test_ConnectEx(void)
...
@@ -5097,7 +5097,7 @@ static void test_ConnectEx(void)
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
pConnectEx
(
connector
,
(
struct
sockaddr
*
)
&
address
,
addrlen
,
NULL
,
0
,
&
bytesReturned
,
&
overlapped
);
bret
=
pConnectEx
(
connector
,
(
struct
sockaddr
*
)
&
address
,
addrlen
,
NULL
,
0
,
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"ConnectEx on a unbound socket "
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"ConnectEx on a unbound socket "
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
if
(
bret
==
TRUE
||
WSAGetLastError
()
!=
WSAEINVAL
)
if
(
bret
==
TRUE
||
WSAGetLastError
()
!=
WSAEINVAL
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment