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
6f3e5090
Commit
6f3e5090
authored
Jul 23, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Do not accept sizeof(struct WS_sockaddr_in6_old).
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d04c5f4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
socket.c
dlls/ntdll/unix/socket.c
+6
-17
No files found.
dlls/ntdll/unix/socket.c
View file @
6f3e5090
...
...
@@ -232,19 +232,14 @@ static socklen_t sockaddr_to_unix( const struct WS_sockaddr *wsaddr, int wsaddrl
{
struct
WS_sockaddr_in6
win
=
{
0
};
if
(
wsaddrlen
<
sizeof
(
struct
WS_sockaddr_in6_old
))
return
0
;
if
(
wsaddrlen
<
sizeof
(
struct
WS_sockaddr_in6
))
memcpy
(
&
win
,
wsaddr
,
sizeof
(
struct
WS_sockaddr_in6_old
)
);
else
memcpy
(
&
win
,
wsaddr
,
sizeof
(
struct
WS_sockaddr_in6
)
);
if
(
wsaddrlen
<
sizeof
(
win
))
return
0
;
memcpy
(
&
win
,
wsaddr
,
sizeof
(
win
)
);
uaddr
->
in6
.
sin6_family
=
AF_INET6
;
uaddr
->
in6
.
sin6_port
=
win
.
sin6_port
;
uaddr
->
in6
.
sin6_flowinfo
=
win
.
sin6_flowinfo
;
memcpy
(
&
uaddr
->
in6
.
sin6_addr
,
&
win
.
sin6_addr
,
sizeof
(
win
.
sin6_addr
)
);
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
if
(
wsaddrlen
>=
sizeof
(
struct
WS_sockaddr_in6
))
uaddr
->
in6
.
sin6_scope_id
=
win
.
sin6_scope_id
;
uaddr
->
in6
.
sin6_scope_id
=
win
.
sin6_scope_id
;
#endif
return
sizeof
(
uaddr
->
in6
);
}
...
...
@@ -303,7 +298,6 @@ static socklen_t sockaddr_to_unix( const struct WS_sockaddr *wsaddr, int wsaddrl
#endif
case
sizeof
(
struct
WS_sockaddr_in6
):
case
sizeof
(
struct
WS_sockaddr_in6_old
):
return
sizeof
(
uaddr
->
in6
);
}
...
...
@@ -335,7 +329,7 @@ static int sockaddr_from_unix( const union unix_sockaddr *uaddr, struct WS_socka
{
struct
WS_sockaddr_in6
win
=
{
0
};
if
(
wsaddrlen
<
sizeof
(
struct
WS_sockaddr_in6_old
))
return
-
1
;
if
(
wsaddrlen
<
sizeof
(
win
))
return
-
1
;
win
.
sin6_family
=
WS_AF_INET6
;
win
.
sin6_port
=
uaddr
->
in6
.
sin6_port
;
win
.
sin6_flowinfo
=
uaddr
->
in6
.
sin6_flowinfo
;
...
...
@@ -343,13 +337,8 @@ static int sockaddr_from_unix( const union unix_sockaddr *uaddr, struct WS_socka
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
win
.
sin6_scope_id
=
uaddr
->
in6
.
sin6_scope_id
;
#endif
if
(
wsaddrlen
>=
sizeof
(
struct
WS_sockaddr_in6
))
{
memcpy
(
wsaddr
,
&
win
,
sizeof
(
struct
WS_sockaddr_in6
)
);
return
sizeof
(
struct
WS_sockaddr_in6
);
}
memcpy
(
wsaddr
,
&
win
,
sizeof
(
struct
WS_sockaddr_in6_old
)
);
return
sizeof
(
struct
WS_sockaddr_in6_old
);
memcpy
(
wsaddr
,
&
win
,
sizeof
(
win
)
);
return
sizeof
(
win
);
}
#ifdef HAS_IPX
...
...
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