crypt32: Always set *ppszError.

This commit is contained in:
Juan Lang 2007-10-20 14:26:00 -07:00 committed by Alexandre Julliard
parent e0b8e37bf0
commit dda8053179
1 changed files with 11 additions and 4 deletions

View File

@ -474,6 +474,8 @@ BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500,
pvReserved, pbEncoded, pcbEncoded,
ppszError ? (LPCWSTR *)&errorStr : NULL);
if (ppszError)
{
if (!ret)
{
DWORD i;
@ -481,6 +483,9 @@ BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500,
for (i = 0; i < errorStr - x500; i++)
*ppszError = CharNextA(*ppszError);
}
else
*ppszError = NULL;
}
CryptMemFree(x500);
}
else
@ -827,6 +832,8 @@ BOOL WINAPI CertStrToNameW(DWORD dwCertEncodingType, LPCWSTR pszX500,
CRYPT_FreeKeynameKeeper(&keeper);
if (!error)
{
if (ppszError)
*ppszError = NULL;
ret = CryptEncodeObjectEx(dwCertEncodingType, X509_NAME, &info,
0, NULL, pbEncoded, pcbEncoded);
for (i = 0; i < info.cRDN; i++)