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
d0009573
Commit
d0009573
authored
Sep 21, 2013
by
Bruno Jesus
Committed by
Alexandre Julliard
Sep 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Fix some parameters checking in AcceptEx.
parent
cba19b90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
socket.c
dlls/ws2_32/socket.c
+7
-0
sock.c
dlls/ws2_32/tests/sock.c
+16
-2
No files found.
dlls/ws2_32/socket.c
View file @
d0009573
...
...
@@ -2319,6 +2319,13 @@ static BOOL WINAPI WS2_AcceptEx(SOCKET listener, SOCKET acceptor, PVOID dest, DW
return
FALSE
;
}
if
((
local_addr_len
<
sizeof
(
struct
sockaddr_in
)
+
16
)
||
(
rem_addr_len
<
sizeof
(
struct
sockaddr_in
)
+
16
))
{
SetLastError
(
WSAEINVAL
);
return
FALSE
;
}
fd
=
get_sock_fd
(
listener
,
FILE_READ_DATA
,
NULL
);
if
(
fd
==
-
1
)
{
...
...
dlls/ws2_32/tests/sock.c
View file @
d0009573
...
...
@@ -5348,12 +5348,22 @@ static void test_AcceptEx(void)
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"AcceptEx on too small local address size "
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"AcceptEx on too small local address size "
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
15
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"AcceptEx on too small local address size "
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
sizeof
(
struct
sockaddr_in
)
+
16
,
0
,
&
bytesReturned
,
&
overlapped
);
todo_wine
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"AcceptEx on too small remote address size "
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"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
,
sizeof
(
struct
sockaddr_in
)
+
15
,
&
bytesReturned
,
&
overlapped
);
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
WSAEINVAL
,
"AcceptEx on too small remote address size "
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
...
...
@@ -5362,6 +5372,10 @@ static void test_AcceptEx(void)
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
ERROR_INVALID_PARAMETER
,
"AcceptEx on a NULL overlapped "
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
0
,
0
,
0
,
&
bytesReturned
,
NULL
);
ok
(
bret
==
FALSE
&&
WSAGetLastError
()
==
ERROR_INVALID_PARAMETER
,
"AcceptEx on a NULL overlapped "
"returned %d + errno %d
\n
"
,
bret
,
WSAGetLastError
());
bret
=
pAcceptEx
(
listener
,
acceptor
,
buffer
,
sizeof
(
buffer
)
-
2
*
(
sizeof
(
struct
sockaddr_in
)
+
16
),
sizeof
(
struct
sockaddr_in
)
+
16
,
sizeof
(
struct
sockaddr_in
)
+
16
,
&
bytesReturned
,
&
overlapped
);
...
...
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