Skip to content
Snippets Groups Projects
Commit 6e0921dd authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Sébastien Blin
Browse files

account: check convModule()

If client calls some APIs from the account, convModule_ may be
un-initialized if the account is not yet ready, causing potential
segfaults

Change-Id: If47c9d5466e42dee58ea1ebbdd71404ee94a82d1
parent c26eeb7a
Branches
No related tags found
No related merge requests found
...@@ -2369,7 +2369,9 @@ JamiAccount::connectivityChanged() ...@@ -2369,7 +2369,9 @@ JamiAccount::connectivityChanged()
// nothing to do // nothing to do
return; return;
} }
convModule()->connectivityChanged();
if (auto cm = convModule())
cm->connectivityChanged();
dht_->connectivityChanged(); dht_->connectivityChanged();
{ {
std::lock_guard<std::mutex> lkCM(connManagerMtx_); std::lock_guard<std::mutex> lkCM(connManagerMtx_);
...@@ -4046,7 +4048,8 @@ JamiAccount::monitor() ...@@ -4046,7 +4048,8 @@ JamiAccount::monitor()
JAMI_DEBUG("[Account {:s}] Monitor connections", getAccountID()); JAMI_DEBUG("[Account {:s}] Monitor connections", getAccountID());
JAMI_DEBUG("[Account {:s}] Using proxy: {:s}", getAccountID(), proxyServerCached_); JAMI_DEBUG("[Account {:s}] Using proxy: {:s}", getAccountID(), proxyServerCached_);
convModule()->monitor(); if (auto cm =convModule())
cm->monitor();
std::lock_guard<std::mutex> lkCM(connManagerMtx_); std::lock_guard<std::mutex> lkCM(connManagerMtx_);
if (connectionManager_) if (connectionManager_)
connectionManager_->monitor(); connectionManager_->monitor();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment