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

Unified Diff: net/cert/x509_certificate.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/cert/x509_certificate.cc
diff --git a/net/cert/x509_certificate.cc b/net/cert/x509_certificate.cc
index 377cb7e5215184f5cecb02f7be3b2d74f8e5c2c3..db0969d72df76c76c400c019f036fd211dd6e937 100644
--- a/net/cert/x509_certificate.cc
+++ b/net/cert/x509_certificate.cc
@@ -445,7 +445,10 @@ CertificateList X509Certificate::CreateCertificateListFromBytes(
for (OSCertHandles::iterator it = certificates.begin();
it != certificates.end(); ++it) {
- results.push_back(CreateFromHandle(*it, OSCertHandles()));
+ scoped_refptr<X509Certificate> cert =
+ CreateFromHandle(*it, OSCertHandles());
+ if (cert)
+ results.push_back(std::move(cert));
FreeOSCertHandle(*it);
}

Powered by Google App Engine
This is Rietveld 408576698