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
5a8ccc15
Commit
5a8ccc15
authored
Jun 07, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Jun 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Check for valid socket in WSAGetOverlappedResult().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
parent
94dc5714
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
+6
-0
sock.c
dlls/ws2_32/tests/sock.c
+13
-0
No files found.
dlls/ws2_32/socket.c
View file @
5a8ccc15
...
...
@@ -3626,6 +3626,12 @@ BOOL WINAPI WSAGetOverlappedResult( SOCKET s, LPWSAOVERLAPPED lpOverlapped,
return
FALSE
;
}
if
(
!
socket_list_find
(
s
))
{
SetLastError
(
WSAENOTSOCK
);
return
FALSE
;
}
status
=
lpOverlapped
->
Internal
;
if
(
status
==
STATUS_PENDING
)
{
...
...
dlls/ws2_32/tests/sock.c
View file @
5a8ccc15
...
...
@@ -11848,6 +11848,7 @@ static void test_WSAGetOverlappedResult(void)
NTSTATUS
status
;
unsigned
int
i
;
SOCKET
s
;
HANDLE
h
;
BOOL
ret
;
static
const
NTSTATUS
ranges
[][
2
]
=
...
...
@@ -11862,8 +11863,20 @@ static void test_WSAGetOverlappedResult(void)
{
0xd0070000
,
0xd0080000
},
};
WSASetLastError
(
0xdeadbeef
);
ret
=
WSAGetOverlappedResult
(
0xdeadbeef
,
&
overlapped
,
&
size
,
FALSE
,
&
flags
);
ok
(
!
ret
,
"got %d.
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAENOTSOCK
,
"got %u.
\n
"
,
WSAGetLastError
());
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
(
HANDLE
)
s
,
GetCurrentProcess
(),
&
h
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
);
ok
(
ret
,
"got %d.
\n
"
,
ret
);
ret
=
WSAGetOverlappedResult
((
SOCKET
)
h
,
&
overlapped
,
&
size
,
FALSE
,
&
flags
);
ok
(
!
ret
,
"got %d.
\n
"
,
ret
);
ok
(
WSAGetLastError
()
==
WSAENOTSOCK
,
"got %u.
\n
"
,
WSAGetLastError
());
CloseHandle
(
h
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ranges
);
++
i
)
{
for
(
status
=
ranges
[
i
][
0
];
status
<
ranges
[
i
][
1
];
++
status
)
...
...
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