Bug 465974: fix firefox crash at startup due to weave using nss without initializing it
authorDan Mills <thunder@mozilla.com>
Fri, 28 Nov 2008 00:33:53 +0900
changeset 45063 92d27d2e81238cbddbeff14dc09b41bd3debb3ae
parent 45062 f76602b3ab86495ff315b0750589fdfbf9fd45c9
child 45064 ff0f954d4513c57f4cb62f9ddb684f8eb18815bc
push idunknown
push userunknown
push dateunknown
bugs465974
Bug 465974: fix firefox crash at startup due to weave using nss without initializing it
services/crypto/WeaveCrypto.cpp
--- a/services/crypto/WeaveCrypto.cpp
+++ b/services/crypto/WeaveCrypto.cpp
@@ -58,16 +58,18 @@
 #define STACK_BUFFER_SIZE 4096
 
 NS_IMPL_ISUPPORTS1(WeaveCrypto, IWeaveCrypto)
 
 WeaveCrypto::WeaveCrypto() :
   mAlgorithm(SEC_OID_AES_256_CBC),
   mKeypairBits(2048)
 {
+  // Ensure that PSM (and thus NSS) is initialized.
+  nsCOMPtr<nsISupports> psm(nsGetServiceByContractID("@mozilla.org/psm;1"));
 }
 
 WeaveCrypto::~WeaveCrypto()
 {
 }
 
 /*
  * Base 64 encoding and decoding...