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
2569123d
Commit
2569123d
authored
Aug 10, 2015
by
Huw Davies
Committed by
Alexandre Julliard
Aug 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Avoid using inet_ntoa() which isn't thread-safe.
parent
f5f025f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
socket.c
dlls/ws2_32/socket.c
+20
-11
No files found.
dlls/ws2_32/socket.c
View file @
2569123d
...
...
@@ -283,9 +283,18 @@ static inline const char *debugstr_sockaddr( const struct WS_sockaddr *a )
switch
(
a
->
sa_family
)
{
case
WS_AF_INET
:
{
char
buf
[
16
];
const
char
*
p
;
struct
WS_sockaddr_in
*
sin
=
(
struct
WS_sockaddr_in
*
)
a
;
p
=
WS_inet_ntop
(
WS_AF_INET
,
&
sin
->
sin_addr
,
buf
,
sizeof
(
buf
)
);
if
(
!
p
)
p
=
"(unknown IPv4 address)"
;
return
wine_dbg_sprintf
(
"{ family AF_INET, address %s, port %d }"
,
inet_ntoa
(((
const
struct
sockaddr_in
*
)
a
)
->
sin_addr
),
ntohs
(((
const
struct
sockaddr_in
*
)
a
)
->
sin_port
));
p
,
ntohs
(
sin
->
sin_port
));
}
case
WS_AF_INET6
:
{
char
buf
[
46
];
...
...
@@ -4004,15 +4013,15 @@ WS_u_short WINAPI WS_ntohs(WS_u_short netshort)
*/
char
*
WINAPI
WS_inet_ntoa
(
struct
WS_in_addr
in
)
{
char
*
s
=
inet_ntoa
(
*
((
struct
in_addr
*
)
&
in
)
);
if
(
s
)
{
struct
per_thread_data
*
data
=
get_per_thread_data
();
strcpy
(
data
->
ntoa_buffer
,
s
);
return
data
->
ntoa_buffer
;
}
SetLastError
(
wsaErrno
());
return
NULL
;
struct
per_thread_data
*
data
=
get_per_thread_data
(
);
sprintf
(
data
->
ntoa_buffer
,
"%u.%u.%u.%u"
,
(
unsigned
int
)(
ntohl
(
in
.
WS_s_addr
)
>>
24
&
0xff
),
(
unsigned
int
)(
ntohl
(
in
.
WS_s_addr
)
>>
16
&
0xff
),
(
unsigned
int
)(
ntohl
(
in
.
WS_s_addr
)
>>
8
&
0xff
),
(
unsigned
int
)(
ntohl
(
in
.
WS_s_addr
)
&
0xff
)
);
return
data
->
ntoa_buffer
;
}
static
const
char
*
debugstr_wsaioctl
(
DWORD
ioctl
)
...
...
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