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
b914a646
Commit
b914a646
authored
Oct 03, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 06, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Return WSAEINVAL if "out_size" is smaller than the minimum size for SIO_ADDRESS_LIST_QUERY.
parent
4e6ebd63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
socket.c
dlls/ws2_32/socket.c
+7
-0
sock.c
dlls/ws2_32/tests/sock.c
+12
-0
No files found.
dlls/ws2_32/socket.c
View file @
b914a646
...
...
@@ -3937,6 +3937,13 @@ INT WINAPI WSAIoctl(SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, LPVOID
return
SOCKET_ERROR
;
}
if
(
out_size
&&
out_size
<
FIELD_OFFSET
(
SOCKET_ADDRESS_LIST
,
Address
[
0
]))
{
*
ret_size
=
0
;
WSASetLastError
(
WSAEINVAL
);
return
SOCKET_ERROR
;
}
if
(
GetAdaptersInfo
(
NULL
,
&
size
)
==
ERROR_BUFFER_OVERFLOW
)
{
IP_ADAPTER_INFO
*
p
,
*
table
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
...
...
dlls/ws2_32/tests/sock.c
View file @
b914a646
...
...
@@ -7498,6 +7498,18 @@ static void test_address_list_query(void)
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAEFAULT
,
"Got unexpected error %d.
\n
"
,
WSAGetLastError
());
bytes_returned
=
0xdeadbeef
;
ret
=
WSAIoctl
(
s
,
SIO_ADDRESS_LIST_QUERY
,
NULL
,
0
,
address_list
,
1
,
&
bytes_returned
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAEINVAL
,
"Got unexpected error %d.
\n
"
,
WSAGetLastError
());
ok
(
bytes_returned
==
0
,
"Got unexpected bytes_returned %u.
\n
"
,
bytes_returned
);
ret
=
WSAIoctl
(
s
,
SIO_ADDRESS_LIST_QUERY
,
NULL
,
0
,
address_list
,
FIELD_OFFSET
(
SOCKET_ADDRESS_LIST
,
Address
[
0
]),
&
bytes_returned
,
NULL
,
NULL
);
ok
(
ret
==
SOCKET_ERROR
,
"Got unexpected ret %d.
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAEFAULT
,
"Got unexpected error %d.
\n
"
,
WSAGetLastError
());
ok
(
bytes_returned
==
size
,
"Got unexpected bytes_returned %u, expected %u.
\n
"
,
bytes_returned
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
address_list
);
closesocket
(
s
);
}
...
...
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