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
7cf611ef
Commit
7cf611ef
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: Fail if MultiByteToWideChar converts 0 characters.
parent
533aa4dc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
str.c
dlls/crypt32/str.c
+19
-5
No files found.
dlls/crypt32/str.c
View file @
7cf611ef
...
...
@@ -455,7 +455,6 @@ BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500,
DWORD
dwStrType
,
void
*
pvReserved
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
,
LPCSTR
*
ppszError
)
{
LPWSTR
x500
,
errorStr
;
BOOL
ret
;
int
len
;
...
...
@@ -464,12 +463,16 @@ BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500,
ppszError
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pszX500
,
-
1
,
NULL
,
0
);
x500
=
CryptMemAlloc
(
len
*
sizeof
(
WCHAR
));
if
(
x500
)
if
(
len
)
{
LPWSTR
x500
,
errorStr
;
if
((
x500
=
CryptMemAlloc
(
len
*
sizeof
(
WCHAR
))))
{
MultiByteToWideChar
(
CP_ACP
,
0
,
pszX500
,
-
1
,
x500
,
len
);
ret
=
CertStrToNameW
(
dwCertEncodingType
,
x500
,
dwStrType
,
pvReserved
,
pbEncoded
,
pcbEncoded
,
ppszError
?
(
LPCWSTR
*
)
&
errorStr
:
NULL
);
ret
=
CertStrToNameW
(
dwCertEncodingType
,
x500
,
dwStrType
,
pvReserved
,
pbEncoded
,
pcbEncoded
,
ppszError
?
(
LPCWSTR
*
)
&
errorStr
:
NULL
);
if
(
ppszError
)
{
DWORD
i
;
...
...
@@ -481,7 +484,18 @@ BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500,
CryptMemFree
(
x500
);
}
else
{
SetLastError
(
ERROR_OUTOFMEMORY
);
ret
=
FALSE
;
}
}
else
{
SetLastError
(
CRYPT_E_INVALID_X500_STRING
);
if
(
ppszError
)
*
ppszError
=
pszX500
;
ret
=
FALSE
;
}
return
ret
;
}
...
...
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