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
e0b8e37b
Commit
e0b8e37b
authored
Oct 20, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Oct 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Don't allocate a 0-length string.
parent
d34b3bf6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
str.c
dlls/crypt32/str.c
+23
-12
No files found.
dlls/crypt32/str.c
View file @
e0b8e37b
...
...
@@ -640,22 +640,33 @@ static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType,
LPCWSTR
*
ppszError
)
{
CERT_NAME_VALUE
nameValue
=
{
type
,
{
0
,
NULL
}
};
BOOL
ret
=
FALS
E
;
BOOL
ret
=
TRU
E
;
nameValue
.
Value
.
pbData
=
CryptMemAlloc
((
value
->
end
-
value
->
start
)
*
sizeof
(
WCHAR
));
if
(
nameValue
.
Value
.
pbData
)
if
(
value
->
end
>
value
->
start
)
{
DWORD
i
;
LPWSTR
ptr
=
(
LPWSTR
)
nameValue
.
Value
.
pbData
;
for
(
i
=
0
;
i
<
value
->
end
-
value
->
start
;
i
++
)
nameValue
.
Value
.
pbData
=
CryptMemAlloc
((
value
->
end
-
value
->
start
)
*
sizeof
(
WCHAR
));
if
(
!
nameValue
.
Value
.
pbData
)
{
*
ptr
++
=
value
->
start
[
i
];
if
(
value
->
start
[
i
]
==
'"'
)
i
++
;
SetLastError
(
ERROR_OUTOFMEMORY
);
ret
=
FALSE
;
}
}
if
(
ret
)
{
if
(
value
->
end
>
value
->
start
)
{
DWORD
i
;
LPWSTR
ptr
=
(
LPWSTR
)
nameValue
.
Value
.
pbData
;
for
(
i
=
0
;
i
<
value
->
end
-
value
->
start
;
i
++
)
{
*
ptr
++
=
value
->
start
[
i
];
if
(
value
->
start
[
i
]
==
'"'
)
i
++
;
}
nameValue
.
Value
.
cbData
=
(
LPBYTE
)
ptr
-
nameValue
.
Value
.
pbData
;
}
nameValue
.
Value
.
cbData
=
(
LPBYTE
)
ptr
-
nameValue
.
Value
.
pbData
;
ret
=
CryptEncodeObjectEx
(
dwCertEncodingType
,
X509_UNICODE_NAME_VALUE
,
&
nameValue
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
output
->
pbData
,
&
output
->
cbData
);
...
...
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