From dbc13b5d232666808a29e0e787883f06082282fd Mon Sep 17 00:00:00 2001 From: "wtc@chromium.org" Date: Fri, 16 Apr 2010 00:59:56 +0000 Subject: Do not call NSS functions if NSS initialization failed. R=agl BUG=36071 TEST=none Review URL: http://codereview.chromium.org/1545034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44728 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/x509_certificate_nss.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/base/x509_certificate_nss.cc') diff --git a/net/base/x509_certificate_nss.cc b/net/base/x509_certificate_nss.cc index 976435d..e311edb 100644 --- a/net/base/x509_certificate_nss.cc +++ b/net/base/x509_certificate_nss.cc @@ -5,6 +5,7 @@ #include "net/base/x509_certificate.h" #include +#include #include #include #include @@ -722,6 +723,9 @@ X509Certificate::OSCertHandle X509Certificate::CreateOSCertHandleFromBytes( const char* data, int length) { base::EnsureNSSInit(); + if (!NSS_IsInitialized()) + return NULL; + // Make a copy of |data| since CERT_DecodeCertPackage might modify it. char* data_copy = new char[length]; memcpy(data_copy, data, length); -- cgit v1.1