Juan Lang : wintrust: Don' t expect ImageGetCertificateData to succeed when Certificate is NULL.

Alexandre Julliard julliard at winehq.org
Tue Jan 15 07:47:10 CST 2008


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Tue Jan  8 11:40:27 2008 -0800

wintrust: Don't expect ImageGetCertificateData to succeed when Certificate is NULL.

---

 dlls/wintrust/crypt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c
index e69db9e..c919eef 100644
--- a/dlls/wintrust/crypt.c
+++ b/dlls/wintrust/crypt.c
@@ -218,10 +218,10 @@ BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO* pSubjectInfo, DWORD* pdwEn
     }
     else
     {
-        DWORD len;
+        DWORD len = 0;
 
         ret = ImageGetCertificateData(pSubjectInfo->hFile, dwIndex, NULL, &len);
-        if (!ret)
+        if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
             goto error;
         pCert = HeapAlloc(GetProcessHeap(), 0, len);
         if (!pCert)




More information about the wine-cvs mailing list