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
f0b42b2f
Commit
f0b42b2f
authored
Jun 16, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Check if the socket is bound in listen() in the server.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43a1a248
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
socket.c
dlls/ws2_32/socket.c
+0
-11
sock.c
server/sock.c
+6
-0
No files found.
dlls/ws2_32/socket.c
View file @
f0b42b2f
...
...
@@ -3282,20 +3282,9 @@ int WINAPI WS_listen( SOCKET s, int backlog )
struct
afd_listen_params
params
=
{.
backlog
=
backlog
};
IO_STATUS_BLOCK
io
;
NTSTATUS
status
;
int
fd
,
bound
;
TRACE
(
"socket %#lx, backlog %d
\n
"
,
s
,
backlog
);
if
((
fd
=
get_sock_fd
(
s
,
FILE_READ_DATA
,
NULL
))
==
-
1
)
return
-
1
;
bound
=
is_fd_bound
(
fd
,
NULL
,
NULL
);
release_sock_fd
(
s
,
fd
);
if
(
bound
<=
0
)
{
SetLastError
(
bound
?
wsaErrno
()
:
WSAEINVAL
);
return
-
1
;
}
status
=
NtDeviceIoControlFile
(
SOCKET2HANDLE
(
s
),
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_AFD_LISTEN
,
&
params
,
sizeof
(
params
),
NULL
,
0
);
SetLastError
(
NtStatusToWSAError
(
status
)
);
...
...
server/sock.c
View file @
f0b42b2f
...
...
@@ -2084,6 +2084,12 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return
0
;
}
if
(
!
sock
->
bound
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
return
0
;
}
if
(
listen
(
unix_fd
,
params
->
backlog
)
<
0
)
{
set_error
(
sock_get_ntstatus
(
errno
)
);
...
...
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