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
ec716f74
Commit
ec716f74
authored
May 09, 2019
by
Akihiro Sagawa
Committed by
Alexandre Julliard
May 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Improve parameter sanity checks in RegLoadMUIString.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b7f3698
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
registry.c
dlls/advapi32/registry.c
+1
-1
registry.c
dlls/advapi32/tests/registry.c
+2
-2
No files found.
dlls/advapi32/registry.c
View file @
ec716f74
...
...
@@ -3183,7 +3183,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer
cbBuffer
,
pcbData
,
dwFlags
,
debugstr_w
(
pwszBaseDir
));
/* Parameter sanity checks. */
if
(
!
hKey
||
!
pwszBuffer
)
if
(
!
hKey
||
(
!
pwszBuffer
&&
cbBuffer
)
||
(
cbBuffer
%
sizeof
(
WCHAR
))
)
return
ERROR_INVALID_PARAMETER
;
/* Check for value existence and correctness of its type, allocate a buffer and load it. */
...
...
dlls/advapi32/tests/registry.c
View file @
ec716f74
...
...
@@ -3896,8 +3896,8 @@ static void test_RegLoadMUIString(void)
memset
(
bufW
,
0xff
,
sizeof
(
bufW
));
ret
=
pRegLoadMUIStringW
(
hkey
,
tz_valueW
,
bufW
,
sizeof
(
WCHAR
)
+
1
,
&
size
,
0
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %d, expected ERROR_INVALID_PARAMETER
\n
"
,
ret
);
todo_wine
ok
(
bufW
[
0
]
==
0xffff
,
"got 0x%04x, expected 0xffff
\n
"
,
bufW
[
0
]);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %d, expected ERROR_INVALID_PARAMETER
\n
"
,
ret
);
ok
(
bufW
[
0
]
==
0xffff
,
"got 0x%04x, expected 0xffff
\n
"
,
bufW
[
0
]);
size
=
0xdeadbeef
;
memset
(
bufW
,
0xff
,
sizeof
(
bufW
));
...
...
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