[PATCH] CryptVerifyMessageSignature: Only clear *pcbDecoded on error

Mikko Rasa tdb at tdb.fi
Wed Aug 18 14:32:41 CDT 2010


---
 dlls/crypt32/message.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/crypt32/message.c b/dlls/crypt32/message.c
index 7551cce..779959a 100644
--- a/dlls/crypt32/message.c
+++ b/dlls/crypt32/message.c
@@ -194,13 +194,13 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
 
     if (ppSignerCert)
         *ppSignerCert = NULL;
-    if (pcbDecoded)
-        *pcbDecoded = 0;
     if (!pVerifyPara ||
      pVerifyPara->cbSize != sizeof(CRYPT_VERIFY_MESSAGE_PARA) ||
      GET_CMSG_ENCODING_TYPE(pVerifyPara->dwMsgAndCertEncodingType) !=
      PKCS_7_ASN_ENCODING)
     {
+        if(pcbDecoded)
+            *pcbDecoded = 0;
         SetLastError(E_INVALIDARG);
         return FALSE;
     }
@@ -246,6 +246,8 @@ BOOL WINAPI CryptVerifyMessageSignature(PCRYPT_VERIFY_MESSAGE_PARA pVerifyPara,
         }
         CryptMsgClose(msg);
     }
+    if(!ret && pcbDecoded)
+        *pcbDecoded = 0;
     TRACE("returning %d\n", ret);
     return ret;
 }
-- 
1.7.1




More information about the wine-patches mailing list