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

Alexandre Julliard julliard at winehq.org
Mon Jul 14 05:56:37 CDT 2008


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Fri Jul 11 08:54:45 2008 -0700

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

---

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

diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c
index 4184e6c..3eb8988 100644
--- a/dlls/crypt32/object.c
+++ b/dlls/crypt32/object.c
@@ -413,10 +413,10 @@ static BOOL CRYPT_QueryEmbeddedMessageObject(DWORD dwObjectType,
      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
     if (file != INVALID_HANDLE_VALUE)
     {
-        DWORD len;
+        DWORD len = 0;
 
         ret = ImageGetCertificateData(file, 0, NULL, &len);
-        if (ret)
+        if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
         {
             WIN_CERTIFICATE *winCert = HeapAlloc(GetProcessHeap(), 0, len);
 




More information about the wine-cvs mailing list