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
3c64a7c4
Commit
3c64a7c4
authored
Feb 05, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Feb 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Fix some parameters checking in AcceptEx.
parent
b3d07c78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
socket.c
dlls/ws2_32/socket.c
+3
-4
sock.c
dlls/ws2_32/tests/sock.c
+1
-6
No files found.
dlls/ws2_32/socket.c
View file @
3c64a7c4
...
@@ -2386,10 +2386,9 @@ static BOOL WINAPI WS2_AcceptEx(SOCKET listener, SOCKET acceptor, PVOID dest, DW
...
@@ -2386,10 +2386,9 @@ static BOOL WINAPI WS2_AcceptEx(SOCKET listener, SOCKET acceptor, PVOID dest, DW
return
FALSE
;
return
FALSE
;
}
}
if
((
local_addr_len
<
sizeof
(
struct
sockaddr_in
)
+
16
)
if
(
!
rem_addr_len
)
||
(
rem_addr_len
<
sizeof
(
struct
sockaddr_in
)
+
16
))
{
{
SetLastError
(
WSAE
INVAL
);
SetLastError
(
WSAE
FAULT
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -2404,7 +2403,7 @@ static BOOL WINAPI WS2_AcceptEx(SOCKET listener, SOCKET acceptor, PVOID dest, DW
...
@@ -2404,7 +2403,7 @@ static BOOL WINAPI WS2_AcceptEx(SOCKET listener, SOCKET acceptor, PVOID dest, DW
fd
=
get_sock_fd
(
acceptor
,
FILE_READ_DATA
,
NULL
);
fd
=
get_sock_fd
(
acceptor
,
FILE_READ_DATA
,
NULL
);
if
(
fd
==
-
1
)
if
(
fd
==
-
1
)
{
{
SetLastError
(
WSAE
INVAL
);
SetLastError
(
WSAE
NOTSOCK
);
return
FALSE
;
return
FALSE
;
}
}
release_sock_fd
(
acceptor
,
fd
);
release_sock_fd
(
acceptor
,
fd
);
...
...
dlls/ws2_32/tests/sock.c
View file @
3c64a7c4
...
@@ -5935,8 +5935,7 @@ todo_wine
...
@@ -5935,8 +5935,7 @@ todo_wine
bret
=
pAcceptEx
(
listener
,
INVALID_SOCKET
,
buffer
,
sizeof
(
buffer
)
-
2
*
(
sizeof
(
struct
sockaddr_in
)
+
16
),
bret
=
pAcceptEx
(
listener
,
INVALID_SOCKET
,
buffer
,
sizeof
(
buffer
)
-
2
*
(
sizeof
(
struct
sockaddr_in
)
+
16
),
sizeof
(
struct
sockaddr_in
)
+
16
,
sizeof
(
struct
sockaddr_in
)
+
16
,
sizeof
(
struct
sockaddr_in
)
+
16
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAENOTSOCK
,
"AcceptEx on invalid accepting socket "
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAENOTSOCK
,
"AcceptEx on invalid listening socket "
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
pAcceptEx
(
listener
,
acceptor
,
NULL
,
sizeof
(
buffer
)
-
2
*
(
sizeof
(
struct
sockaddr_in
)
+
16
),
bret
=
pAcceptEx
(
listener
,
acceptor
,
NULL
,
sizeof
(
buffer
)
-
2
*
(
sizeof
(
struct
sockaddr_in
)
+
16
),
...
@@ -5949,7 +5948,6 @@ todo_wine
...
@@ -5949,7 +5948,6 @@ todo_wine
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
(
WSAGetLastError
()
==
ERROR_IO_PENDING
||
broken
(
WSAGetLastError
()
==
WSAEINVAL
))
/* NT4 */
,
ok
(
bret
==
FALSE
&&
(
WSAGetLastError
()
==
ERROR_IO_PENDING
||
broken
(
WSAGetLastError
()
==
WSAEINVAL
))
/* NT4 */
,
"AcceptEx on too small local address size returned %d + errno %d
\n
"
,
"AcceptEx on too small local address size returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
,
WSAGetLastError
());
...
@@ -5958,7 +5956,6 @@ todo_wine
...
@@ -5958,7 +5956,6 @@ todo_wine
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
15
,
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
15
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
ERROR_IO_PENDING
,
"AcceptEx on too small local address "
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
ERROR_IO_PENDING
,
"AcceptEx on too small local address "
"size returned %d + errno %d
\n
"
,
"size returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
,
WSAGetLastError
());
...
@@ -5967,13 +5964,11 @@ todo_wine
...
@@ -5967,13 +5964,11 @@ todo_wine
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
0
,
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
0
,
&
bytesReturned
,
&
overlapped
);
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
(
WSAGetLastError
()
==
WSAEFAULT
||
broken
(
WSAGetLastError
()
==
WSAEINVAL
))
/* NT4 */
,
ok
(
bret
==
FALSE
&&
(
WSAGetLastError
()
==
WSAEFAULT
||
broken
(
WSAGetLastError
()
==
WSAEINVAL
))
/* NT4 */
,
"AcceptEx on too small remote address size returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
"AcceptEx on too small remote address size returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
sizeof
(
struct
sockaddr_in
)
+
15
,
&
bytesReturned
,
&
overlapped
);
sizeof
(
struct
sockaddr_in
)
+
15
,
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
(
WSAGetLastError
()
==
ERROR_IO_PENDING
||
broken
(
WSAGetLastError
()
==
WSAEINVAL
))
/* NT4 */
,
ok
(
bret
==
FALSE
&&
(
WSAGetLastError
()
==
ERROR_IO_PENDING
||
broken
(
WSAGetLastError
()
==
WSAEINVAL
))
/* NT4 */
,
"AcceptEx on too small remote address size returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
"AcceptEx on too small remote address size returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
CancelIo
((
HANDLE
)
listener
);
bret
=
CancelIo
((
HANDLE
)
listener
);
...
...
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