summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
Diffstat (limited to 'net/base')
-rw-r--r--net/base/x509_certificate_nss.cc4
1 files changed, 4 insertions, 0 deletions
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 <cert.h>
+#include <nss.h>
#include <pk11pub.h>
#include <prerror.h>
#include <prtime.h>
@@ -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);