Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Unified Diff: net/ssl/client_cert_store_mac.cc

Issue 2760723002: Check X509Certificate::CreateFromHandle result. (Closed)
Patch Set: 2nd round of updates Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698