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
862eab28
Commit
862eab28
authored
Jan 19, 2011
by
Juan Lang
Committed by
Alexandre Julliard
Jan 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Ensure temporary string is NULL-terminated to avoid uninitialized…
crypt32: Ensure temporary string is NULL-terminated to avoid uninitialized memory access (valgrind).
parent
c3bc7f2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
str.c
dlls/crypt32/str.c
+6
-1
No files found.
dlls/crypt32/str.c
View file @
862eab28
...
@@ -789,7 +789,7 @@ static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType,
...
@@ -789,7 +789,7 @@ static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType,
LONG
i
;
LONG
i
;
LPWSTR
ptr
;
LPWSTR
ptr
;
nameValue
.
Value
.
pbData
=
CryptMemAlloc
((
value
->
end
-
value
->
start
)
*
nameValue
.
Value
.
pbData
=
CryptMemAlloc
((
value
->
end
-
value
->
start
+
1
)
*
sizeof
(
WCHAR
));
sizeof
(
WCHAR
));
if
(
!
nameValue
.
Value
.
pbData
)
if
(
!
nameValue
.
Value
.
pbData
)
{
{
...
@@ -803,6 +803,11 @@ static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType,
...
@@ -803,6 +803,11 @@ static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType,
if
(
value
->
start
[
i
]
==
'"'
)
if
(
value
->
start
[
i
]
==
'"'
)
i
++
;
i
++
;
}
}
/* The string is NULL terminated because of a quirk in encoding
* unicode names values: if the length is given as 0, the value is
* assumed to be a NULL-terminated string.
*/
*
ptr
=
0
;
nameValue
.
Value
.
cbData
=
(
LPBYTE
)
ptr
-
nameValue
.
Value
.
pbData
;
nameValue
.
Value
.
cbData
=
(
LPBYTE
)
ptr
-
nameValue
.
Value
.
pbData
;
}
}
ret
=
CryptEncodeObjectEx
(
dwCertEncodingType
,
X509_UNICODE_NAME_VALUE
,
ret
=
CryptEncodeObjectEx
(
dwCertEncodingType
,
X509_UNICODE_NAME_VALUE
,
...
...
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