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

Unified Diff: net/ssl/client_cert_store_win.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_win.cc
diff --git a/net/ssl/client_cert_store_win.cc b/net/ssl/client_cert_store_win.cc
index 499d1c4b55ecb8cca0ff0a90a3130b5e78a5ec43..cdeee46c12ca889a2c0dfb062fd1471c51b5a0a8 100644
--- a/net/ssl/client_cert_store_win.cc
+++ b/net/ssl/client_cert_store_win.cc
@@ -149,7 +149,8 @@ void GetClientCertsImpl(HCERTSTORE cert_store,
// pair<X509Certificate, SSLPrivateKeyCallback>.
scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle(
cert_context2, intermediates);
- selected_certs->push_back(cert);
+ if (cert)
+ selected_certs->push_back(std::move(cert));
CertFreeCertificateContext(cert_context2);
for (size_t i = 0; i < intermediates.size(); ++i)
CertFreeCertificateContext(intermediates[i]);

Powered by Google App Engine
This is Rietveld 408576698