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
55b3e609
Commit
55b3e609
authored
Dec 21, 2023
by
Huw Davies
Committed by
Alexandre Julliard
Dec 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnsapi: Update the array ptr in the insufficient buffer case.
Fixes a regression caused by
da65aa5b
.
parent
6e966845
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
query.c
dlls/dnsapi/query.c
+7
-7
No files found.
dlls/dnsapi/query.c
View file @
55b3e609
...
...
@@ -329,9 +329,9 @@ static DNS_STATUS get_hostname_w( COMPUTER_NAME_FORMAT format, PWSTR buffer, PDW
static
DNS_STATUS
get_dns_server_list
(
IP4_ARRAY
*
out
,
DWORD
*
len
)
{
char
buf
[
FIELD_OFFSET
(
DNS_ADDR_ARRAY
,
AddrArray
[
3
])];
DNS_ADDR_ARRAY
*
servers
=
(
DNS_ADDR_ARRAY
*
)
buf
;
DWORD
ret
,
needed
,
i
,
num
,
array_len
=
sizeof
(
buf
);
struct
get_serverlist_params
params
=
{
AF_INET
,
servers
,
&
array_len
};
struct
get_serverlist_params
params
=
{
AF_INET
,
(
DNS_ADDR_ARRAY
*
)
buf
,
&
array_len
};
for
(;;)
{
ret
=
RESOLV_CALL
(
get_serverlist
,
&
params
);
...
...
@@ -346,9 +346,9 @@ static DNS_STATUS get_dns_server_list( IP4_ARRAY *out, DWORD *len )
}
if
(
!
ret
)
break
;
if
((
char
*
)
servers
!=
buf
)
free
(
serve
rs
);
serve
rs
=
malloc
(
array_len
);
if
(
!
serve
rs
)
if
((
char
*
)
params
.
addrs
!=
buf
)
free
(
params
.
add
rs
);
params
.
add
rs
=
malloc
(
array_len
);
if
(
!
params
.
add
rs
)
{
ret
=
ERROR_NOT_ENOUGH_MEMORY
;
goto
err
;
...
...
@@ -357,12 +357,12 @@ static DNS_STATUS get_dns_server_list( IP4_ARRAY *out, DWORD *len )
out
->
AddrCount
=
num
;
for
(
i
=
0
;
i
<
num
;
i
++
)
out
->
AddrArray
[
i
]
=
((
SOCKADDR_IN
*
)
serve
rs
->
AddrArray
[
i
].
MaxSa
)
->
sin_addr
.
s_addr
;
out
->
AddrArray
[
i
]
=
((
SOCKADDR_IN
*
)
params
.
add
rs
->
AddrArray
[
i
].
MaxSa
)
->
sin_addr
.
s_addr
;
*
len
=
needed
;
ret
=
ERROR_SUCCESS
;
err:
if
((
char
*
)
servers
!=
buf
)
free
(
serve
rs
);
if
((
char
*
)
params
.
addrs
!=
buf
)
free
(
params
.
add
rs
);
return
ret
;
}
...
...
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