Juan Lang : wintrust: In SoftpubLoadSignature, don' t assume a message is present.

Alexandre Julliard julliard at winehq.org
Mon Oct 1 07:54:58 CDT 2007


Module: wine
Branch: master
Commit: d7d4a5c4a96d662abe79268b6e956145e85493d7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d7d4a5c4a96d662abe79268b6e956145e85493d7

Author: Juan Lang <juan.lang at gmail.com>
Date:   Fri Sep 28 12:47:03 2007 -0700

wintrust: In SoftpubLoadSignature, don't assume a message is present.

---

 dlls/wintrust/softpub.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c
index 59e4966..5a2aab5 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();




More information about the wine-cvs mailing list