From dda80531799579caa0880e6a793ad25d18418369 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Sat, 20 Oct 2007 14:26:00 -0700 Subject: [PATCH] crypt32: Always set *ppszError. --- dlls/crypt32/str.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/crypt32/str.c b/dlls/crypt32/str.c index a4dc60f6eff..9817b9e07aa 100644 --- a/dlls/crypt32/str.c +++ b/dlls/crypt32/str.c @@ -475,11 +475,16 @@ BOOL WINAPI CertStrToNameA(DWORD dwCertEncodingType, LPCSTR pszX500, ppszError ? (LPCWSTR *)&errorStr : NULL); if (ppszError) { - DWORD i; + if (!ret) + { + DWORD i; - *ppszError = pszX500; - for (i = 0; i < errorStr - x500; i++) - *ppszError = CharNextA(*ppszError); + *ppszError = pszX500; + for (i = 0; i < errorStr - x500; i++) + *ppszError = CharNextA(*ppszError); + } + else + *ppszError = NULL; } CryptMemFree(x500); } @@ -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++)