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
53a065ae
Commit
53a065ae
authored
Nov 23, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix key name null termination (Coverity).
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
19d29f3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
str.c
dlls/crypt32/str.c
+6
-10
No files found.
dlls/crypt32/str.c
View file @
53a065ae
...
...
@@ -769,7 +769,7 @@ struct KeynameKeeper
{
WCHAR
buf
[
10
];
/* big enough for L"GivenName" */
LPWSTR
keyName
;
/* usually = buf, but may be allocated */
DWORD
keyLen
;
DWORD
keyLen
;
/* full available buffer size in WCHARs */
};
static
void
CRYPT_InitializeKeynameKeeper
(
struct
KeynameKeeper
*
keeper
)
...
...
@@ -795,17 +795,13 @@ static void CRYPT_KeynameKeeperFromTokenW(struct KeynameKeeper *keeper,
{
DWORD
len
=
key
->
end
-
key
->
start
;
if
(
len
>
keeper
->
keyLen
)
if
(
len
>
=
keeper
->
keyLen
)
{
if
(
keeper
->
keyName
==
keeper
->
buf
)
keeper
->
keyName
=
CryptMemAlloc
(
len
*
sizeof
(
WCHAR
));
else
keeper
->
keyName
=
CryptMemRealloc
(
keeper
->
keyName
,
len
*
sizeof
(
WCHAR
));
keeper
->
keyLen
=
len
;
CRYPT_FreeKeynameKeeper
(
keeper
);
keeper
->
keyLen
=
len
+
1
;
keeper
->
keyName
=
CryptMemAlloc
(
keeper
->
keyLen
*
sizeof
(
WCHAR
));
}
memcpy
(
keeper
->
keyName
,
key
->
start
,
(
key
->
end
-
key
->
start
)
*
sizeof
(
WCHAR
));
memcpy
(
keeper
->
keyName
,
key
->
start
,
len
*
sizeof
(
WCHAR
));
keeper
->
keyName
[
len
]
=
'\0'
;
TRACE
(
"Keyname is %s
\n
"
,
debugstr_w
(
keeper
->
keyName
));
}
...
...
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