Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
4af902eb
Commit
4af902eb
authored
Aug 18, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Use realloc() in get_{host, proto, serv}ent_buffer().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
357fb2be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
17 deletions
+29
-17
protocol.c
dlls/ws2_32/protocol.c
+29
-17
No files found.
dlls/ws2_32/protocol.c
View file @
4af902eb
...
...
@@ -591,13 +591,18 @@ int WINAPI GetNameInfoW( const SOCKADDR *addr, socklen_t addr_len, WCHAR *host,
static
struct
hostent
*
get_hostent_buffer
(
unsigned
int
size
)
{
struct
per_thread_data
*
data
=
get_per_thread_data
();
if
(
data
->
he_buffer
)
struct
hostent
*
new_buffer
;
if
(
data
->
he_len
<
size
)
{
if
(
data
->
he_len
>=
size
)
return
data
->
he_buffer
;
free
(
data
->
he_buffer
);
if
(
!
(
new_buffer
=
realloc
(
data
->
he_buffer
,
size
)))
{
SetLastError
(
WSAENOBUFS
);
return
NULL
;
}
data
->
he_buffer
=
new_buffer
;
data
->
he_len
=
size
;
}
data
->
he_buffer
=
malloc
(
(
data
->
he_len
=
size
)
);
if
(
!
data
->
he_buffer
)
SetLastError
(
WSAENOBUFS
);
return
data
->
he_buffer
;
}
...
...
@@ -1004,15 +1009,18 @@ static char *next_non_space( const char *p, const char *end )
static
struct
protoent
*
get_protoent_buffer
(
unsigned
int
size
)
{
struct
per_thread_data
*
data
=
get_per_thread_data
();
struct
protoent
*
new_buffer
;
if
(
data
->
pe_
buffer
)
if
(
data
->
pe_
len
<
size
)
{
if
(
data
->
pe_len
>=
size
)
return
data
->
pe_buffer
;
free
(
data
->
pe_buffer
);
if
(
!
(
new_buffer
=
realloc
(
data
->
pe_buffer
,
size
)))
{
SetLastError
(
WSAENOBUFS
);
return
NULL
;
}
data
->
pe_buffer
=
new_buffer
;
data
->
pe_len
=
size
;
}
data
->
pe_len
=
size
;
data
->
pe_buffer
=
malloc
(
size
);
if
(
!
data
->
pe_buffer
)
SetLastError
(
WSAENOBUFS
);
return
data
->
pe_buffer
;
}
...
...
@@ -1187,14 +1195,18 @@ struct protoent * WINAPI getprotobynumber( int number )
static
struct
servent
*
get_servent_buffer
(
int
size
)
{
struct
per_thread_data
*
data
=
get_per_thread_data
();
if
(
data
->
se_buffer
)
struct
servent
*
new_buffer
;
if
(
data
->
se_len
<
size
)
{
if
(
data
->
se_len
>=
size
)
return
data
->
se_buffer
;
free
(
data
->
se_buffer
);
if
(
!
(
new_buffer
=
realloc
(
data
->
se_buffer
,
size
)))
{
SetLastError
(
WSAENOBUFS
);
return
NULL
;
}
data
->
se_buffer
=
new_buffer
;
data
->
se_len
=
size
;
}
data
->
se_len
=
size
;
data
->
se_buffer
=
malloc
(
size
);
if
(
!
data
->
se_buffer
)
SetLastError
(
WSAENOBUFS
);
return
data
->
se_buffer
;
}
...
...
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