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
f7eb53b1
Commit
f7eb53b1
authored
Aug 29, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh: Avoid potential buffer overflows in registry key name.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
58415214
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
rsaenh.c
dlls/rsaenh/rsaenh.c
+15
-18
No files found.
dlls/rsaenh/rsaenh.c
View file @
f7eb53b1
...
...
@@ -1096,7 +1096,7 @@ static void store_key_permissions(HCRYPTKEY hCryptKey, HKEY hKey, DWORD dwKeySpe
*/
static
BOOL
create_container_key
(
KEYCONTAINER
*
pKeyContainer
,
REGSAM
sam
,
HKEY
*
phKey
)
{
CHAR
szRSABase
[
MAX_PATH
];
CHAR
szRSABase
[
sizeof
(
RSAENH_REGKEY
)
+
MAX_PATH
];
HKEY
hRootKey
;
sprintf
(
szRSABase
,
RSAENH_REGKEY
,
pKeyContainer
->
szName
);
...
...
@@ -1127,7 +1127,7 @@ static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY *
*/
static
BOOL
open_container_key
(
LPCSTR
pszContainerName
,
DWORD
dwFlags
,
REGSAM
access
,
HKEY
*
phKey
)
{
CHAR
szRSABase
[
MAX_PATH
];
CHAR
szRSABase
[
sizeof
(
RSAENH_REGKEY
)
+
MAX_PATH
];
HKEY
hRootKey
;
sprintf
(
szRSABase
,
RSAENH_REGKEY
,
pszContainerName
);
...
...
@@ -1154,24 +1154,21 @@ static BOOL open_container_key(LPCSTR pszContainerName, DWORD dwFlags, REGSAM ac
*/
static
BOOL
delete_container_key
(
LPCSTR
pszContainerName
,
DWORD
dwFlags
)
{
CHAR
szRegKey
[
MAX_PATH
];
CHAR
szRegKey
[
sizeof
(
RSAENH_REGKEY
)
+
MAX_PATH
];
HKEY
hRootKey
;
if
(
snprintf
(
szRegKey
,
MAX_PATH
,
RSAENH_REGKEY
,
pszContainerName
)
>=
MAX_PATH
)
{
SetLastError
(
NTE_BAD_KEYSET_PARAM
);
return
FALSE
;
sprintf
(
szRegKey
,
RSAENH_REGKEY
,
pszContainerName
);
if
(
dwFlags
&
CRYPT_MACHINE_KEYSET
)
hRootKey
=
HKEY_LOCAL_MACHINE
;
else
hRootKey
=
HKEY_CURRENT_USER
;
if
(
!
RegDeleteKeyA
(
hRootKey
,
szRegKey
))
{
SetLastError
(
ERROR_SUCCESS
);
return
TRUE
;
}
else
{
HKEY
hRootKey
;
if
(
dwFlags
&
CRYPT_MACHINE_KEYSET
)
hRootKey
=
HKEY_LOCAL_MACHINE
;
else
hRootKey
=
HKEY_CURRENT_USER
;
if
(
!
RegDeleteKeyA
(
hRootKey
,
szRegKey
))
{
SetLastError
(
ERROR_SUCCESS
);
return
TRUE
;
}
else
{
SetLastError
(
NTE_BAD_KEYSET
);
return
FALSE
;
}
SetLastError
(
NTE_BAD_KEYSET
);
return
FALSE
;
}
}
...
...
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