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

Unified Diff: net/base/x509_certificate_nss.cc

Issue 1545034: Do not call NSS functions if NSS initialization failed.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 8 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
« no previous file with comments | « base/nss_util.cc ('k') | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_nss.cc
===================================================================
--- net/base/x509_certificate_nss.cc (revision 44427)
+++ net/base/x509_certificate_nss.cc (working copy)
@@ -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 @@
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);
« no previous file with comments | « base/nss_util.cc ('k') | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698