Index: net/ssl/client_cert_store_mac.cc |
diff --git a/net/ssl/client_cert_store_mac.cc b/net/ssl/client_cert_store_mac.cc |
index 93debe9621e5a61e1764dba626341d0f95f88539..d94ab1856d04c6ee2a6a15cec9c9607642e65570 100644 |
--- a/net/ssl/client_cert_store_mac.cc |
+++ b/net/ssl/client_cert_store_mac.cc |
@@ -114,7 +114,7 @@ bool IsIssuedByInKeychain(const std::vector<std::string>& valid_issuers, |
cert_handle, intermediates)); |
CFRelease(cert_chain); // Also frees |intermediates|. |
- if (!new_cert->IsIssuedByEncoded(valid_issuers)) |
+ if (!new_cert || !new_cert->IsIssuedByEncoded(valid_issuers)) |
return false; |
cert->swap(new_cert); |
@@ -290,6 +290,8 @@ void ClientCertStoreMac::GetClientCerts(const SSLCertRequestInfo& request, |
scoped_refptr<X509Certificate> cert( |
X509Certificate::CreateFromHandle(cert_handle, |
X509Certificate::OSCertHandles())); |
+ if (!cert) |
+ continue; |
if (preferred_identity && CFEqual(preferred_identity, identity)) { |
// Only one certificate should match. |