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

Unified Diff: net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp

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/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
diff --git a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
index a2466559da444ee0aaba932987b908c8db742a82..3b607e13b5e5da029051f514e01d9daa9562d106 100644
--- a/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
+++ b/net/third_party/mozilla_security_manager/nsPKCS12Blob.cpp
@@ -225,8 +225,10 @@ nsPKCS12Blob_ImportHelper(const char* pkcs12_data,
if (imported_certs) {
// Empty list of intermediates.
net::X509Certificate::OSCertHandles intermediates;
- imported_certs->push_back(
- net::X509Certificate::CreateFromHandle(cert, intermediates));
+ scoped_refptr<net::X509Certificate> x509_cert =
+ net::X509Certificate::CreateFromHandle(cert, intermediates);
+ if (x509_cert)
+ imported_certs->push_back(std::move(x509_cert));
}
// Once we have determined that the imported certificate has an

Powered by Google App Engine
This is Rietveld 408576698