Juan Lang : cryptui: Don't crash if a chain can' t be created for the viewed cert.

Alexandre Julliard julliard at winehq.org
Fri Dec 19 11:19:42 CST 2008


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Dec 18 16:54:39 2008 -0800

cryptui: Don't crash if a chain can't be created for the viewed cert.

---

 dlls/cryptui/main.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c
index 6b00c37..169d0cd 100644
--- a/dlls/cryptui/main.c
+++ b/dlls/cryptui/main.c
@@ -742,8 +742,9 @@ static void set_cert_info(HWND hwnd,
     CRYPT_PROVIDER_CERT *root =
      &provSigner->pasCertChain[provSigner->csCertChain - 1];
 
-    if (provSigner->pChainContext->TrustStatus.dwErrorStatus &
-     CERT_TRUST_IS_PARTIAL_CHAIN)
+    if (!provSigner->pChainContext ||
+     (provSigner->pChainContext->TrustStatus.dwErrorStatus &
+     CERT_TRUST_IS_PARTIAL_CHAIN))
         add_icon_to_control(icon, IDB_CERT_WARNING);
     else if (!root->fTrustedRoot)
         add_icon_to_control(icon, IDB_CERT_ERROR);
@@ -767,8 +768,9 @@ static void set_cert_info(HWND hwnd,
     if (provSigner->dwError == TRUST_E_CERT_SIGNATURE)
         add_string_resource_with_paraformat_to_control(text,
          IDS_CERT_INFO_BAD_SIG, &parFmt);
-    else if (provSigner->pChainContext->TrustStatus.dwErrorStatus &
-     CERT_TRUST_IS_PARTIAL_CHAIN)
+    else if (!provSigner->pChainContext ||
+     (provSigner->pChainContext->TrustStatus.dwErrorStatus &
+     CERT_TRUST_IS_PARTIAL_CHAIN))
         add_string_resource_with_paraformat_to_control(text,
          IDS_CERT_INFO_PARTIAL_CHAIN, &parFmt);
     else if (!root->fTrustedRoot)




More information about the wine-cvs mailing list