From d7d4a5c4a96d662abe79268b6e956145e85493d7 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Fri, 28 Sep 2007 12:47:03 -0700 Subject: [PATCH] wintrust: In SoftpubLoadSignature, don't assume a message is present. --- dlls/wintrust/softpub.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 59e4966a78a..5a2aab5522e 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -452,28 +452,34 @@ static BOOL WINTRUST_VerifySigner(CRYPT_PROVIDER_DATA *data, DWORD signerIdx) HRESULT WINAPI SoftpubLoadSignature(CRYPT_PROVIDER_DATA *data) { BOOL ret; - DWORD signerCount, size; TRACE("(%p)\n", data); if (!data->padwTrustStepErrors) return S_FALSE; - size = sizeof(signerCount); - ret = CryptMsgGetParam(data->hMsg, CMSG_SIGNER_COUNT_PARAM, 0, - &signerCount, &size); - if (ret) + if (data->hMsg) { - DWORD i; + DWORD signerCount, size; - for (i = 0; ret && i < signerCount; i++) + size = sizeof(signerCount); + ret = CryptMsgGetParam(data->hMsg, CMSG_SIGNER_COUNT_PARAM, 0, + &signerCount, &size); + if (ret) { - if ((ret = WINTRUST_SaveSigner(data, i))) - ret = WINTRUST_VerifySigner(data, i); + DWORD i; + + for (i = 0; ret && i < signerCount; i++) + { + if ((ret = WINTRUST_SaveSigner(data, i))) + ret = WINTRUST_VerifySigner(data, i); + } } + else + SetLastError(TRUST_E_NOSIGNATURE); } else - SetLastError(TRUST_E_NOSIGNATURE); + ret = TRUE; if (!ret) data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = GetLastError(); -- 2.11.4.GIT