diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-08-09 22:47:19 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-08-09 22:47:19 +0300 |
commit | 6a7bbe0159c3d92368d674cea9cf3057784ba848 (patch) | |
tree | a54d42382fdcc4102e22d1c5c4ecdef47baf58d9 /indra/newview | |
parent | 608403a8466a44a5aa46c6cae4a7a65ac4bf0084 (diff) |
STORM-1546 FIXED Fixed a crash caused by a race condition in LLRefCount.
Reason:
secapiSSLCertVerifyCallback() seems to be called simultaneously by multiple threads,
which causes a race condition in LLRefCount::ref/unref() methods.
The reference counter in LLSecAPIBasicHandler::mStore goes to zero, and the object gets destroyed.
Fix:
Derive LLCertificateStore from LLThreadSafeRefCount instead of LLRefCount,
which should fix the race condition.
Note:
The LLThreadSafeRefCount constructor is private, so we have to wrap instances of the class with LLPointer.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llsecapi.h | 2 | ||||
-rw-r--r-- | indra/newview/llsechandler_basic.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h index b65cf37e7f..8e4c2c56c6 100644 --- a/indra/newview/llsecapi.h +++ b/indra/newview/llsecapi.h @@ -160,7 +160,7 @@ public: // base class for a list of certificates. -class LLCertificateVector : public LLRefCount +class LLCertificateVector : public LLThreadSafeRefCount { public: diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 90e8ff0aae..904bb03270 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -1209,12 +1209,12 @@ void LLSecAPIBasicHandler::init() // with the product std::string ca_file_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "CA.pem"); llinfos << "app path " << ca_file_path << llendl; - LLBasicCertificateStore app_ca_store = LLBasicCertificateStore(ca_file_path); + LLPointer<LLBasicCertificateStore> app_ca_store = new LLBasicCertificateStore(ca_file_path); // push the applicate CA files into the store, therefore adding any new CA certs that // updated - for(LLCertificateVector::iterator i = app_ca_store.begin(); - i != app_ca_store.end(); + for(LLCertificateVector::iterator i = app_ca_store->begin(); + i != app_ca_store->end(); i++) { mStore->add(*i); |