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
4e19373c
Commit
4e19373c
authored
May 01, 2022
by
Torge Matthies
Committed by
Alexandre Julliard
May 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Calculate buffer sizes from registry structs correctly.
Signed-off-by:
Torge Matthies
<
tmatthies@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cf7cb993
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
reg.c
dlls/ntdll/reg.c
+3
-3
system.c
dlls/ntdll/unix/system.c
+1
-1
No files found.
dlls/ntdll/reg.c
View file @
4e19373c
...
...
@@ -93,7 +93,7 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG
if
(
out
->
MaximumLength
)
{
dwLen
=
out
->
MaximumLength
+
sizeof
(
KEY_BASIC_INFORMATION
);
dwLen
=
out
->
MaximumLength
+
offsetof
(
KEY_BASIC_INFORMATION
,
Name
);
info
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
dwLen
);
if
(
!
info
)
return
STATUS_NO_MEMORY
;
...
...
@@ -105,7 +105,7 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG
}
ret
=
NtEnumerateKey
(
handle
,
index
,
KeyBasicInformation
,
info
,
dwLen
,
&
dwResultLen
);
dwResultLen
-=
sizeof
(
KEY_BASIC_INFORMATION
);
dwResultLen
-=
offsetof
(
KEY_BASIC_INFORMATION
,
Name
);
if
(
ret
==
STATUS_BUFFER_OVERFLOW
)
out
->
Length
=
dwResultLen
;
...
...
@@ -138,7 +138,7 @@ NTSTATUS WINAPI RtlpNtQueryValueKey( HANDLE handle, ULONG *result_type, PBYTE de
UNICODE_STRING
name
;
NTSTATUS
ret
;
DWORD
dwResultLen
;
DWORD
dwLen
=
sizeof
(
KEY_VALUE_PARTIAL_INFORMATION
)
+
(
result_len
?
*
result_len
:
0
);
DWORD
dwLen
=
offsetof
(
KEY_VALUE_PARTIAL_INFORMATION
,
Data
[
result_len
?
*
result_len
:
0
]
);
info
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
dwLen
);
if
(
!
info
)
...
...
dlls/ntdll/unix/system.c
View file @
4e19373c
...
...
@@ -2095,7 +2095,7 @@ static BOOL reg_query_value( HKEY key, LPCWSTR name, DWORD type, void *data, DWO
UNICODE_STRING
nameW
;
KEY_VALUE_PARTIAL_INFORMATION
*
info
=
(
KEY_VALUE_PARTIAL_INFORMATION
*
)
buf
;
if
(
count
>
sizeof
(
buf
)
-
sizeof
(
KEY_VALUE_PARTIAL_INFORMATION
))
return
FALSE
;
if
(
count
>
sizeof
(
buf
)
-
offsetof
(
KEY_VALUE_PARTIAL_INFORMATION
,
Data
))
return
FALSE
;
nameW
.
Buffer
=
(
WCHAR
*
)
name
;
nameW
.
Length
=
wcslen
(
name
)
*
sizeof
(
WCHAR
);
...
...
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