diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 00:59:56 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-16 00:59:56 +0000 |
commit | dbc13b5d232666808a29e0e787883f06082282fd (patch) | |
tree | 54e9c83e9f0431345b29ae64a7ecc01146140fae /net/socket/ssl_client_socket_nss.cc | |
parent | 0bbd6db7289b9b9337203715fd8d037f975bd044 (diff) | |
download | chromium_src-dbc13b5d232666808a29e0e787883f06082282fd.zip chromium_src-dbc13b5d232666808a29e0e787883f06082282fd.tar.gz chromium_src-dbc13b5d232666808a29e0e787883f06082282fd.tar.bz2 |
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
Diffstat (limited to 'net/socket/ssl_client_socket_nss.cc')
-rw-r--r-- | net/socket/ssl_client_socket_nss.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc index cdb8fa8..35e48e9 100644 --- a/net/socket/ssl_client_socket_nss.cc +++ b/net/socket/ssl_client_socket_nss.cc @@ -266,6 +266,8 @@ int SSLClientSocketNSS::Init() { // Initialize the NSS SSL library in a threadsafe way. This also // initializes the NSS base library. EnsureNSSSSLInit(); + if (!NSS_IsInitialized()) + return ERR_UNEXPECTED; #if !defined(OS_WIN) // We must call EnsureOCSPInit() here, on the IO thread, to get the IO loop // by MessageLoopForIO::current(). @@ -290,11 +292,13 @@ int SSLClientSocketNSS::Connect(CompletionCallback* callback, net_log.BeginEvent(NetLog::TYPE_SSL_CONNECT); - if (Init() != OK) { - NOTREACHED() << "Couldn't initialize nss"; + int rv = Init(); + if (rv != OK) { + net_log.EndEvent(NetLog::TYPE_SSL_CONNECT); + return rv; } - int rv = InitializeSSLOptions(); + rv = InitializeSSLOptions(); if (rv != OK) { net_log.EndEvent(NetLog::TYPE_SSL_CONNECT); return rv; |